Loading...
Searching...
No Matches
EnvironmentGpuApi.h File Reference

Go to the source code of this file.

Functions

void * gpr_stdpar_environment_create_v1 (char *error, std::size_t capacity) noexcept
void gpr_stdpar_environment_destroy_v1 (void *workspace) noexcept
int gpr_stdpar_environment_blocks_v1 (void *workspace, const gpr::detail::EnvironmentPairBatch *batch, double *blocks, char *error, std::size_t capacity) noexcept

Function Documentation

◆ gpr_stdpar_environment_blocks_v1()

int gpr_stdpar_environment_blocks_v1 ( void * workspace,
const gpr::detail::EnvironmentPairBatch * batch,
double * blocks,
char * error,
std::size_t capacity )
noexcept

Definition at line 187 of file EnvironmentStdparGpu.cpp.

190{
191 try {
192 if (!workspace || !batch)
193 throw std::invalid_argument("GPU workspace and batch are required");
194 assemble(*static_cast<Workspace*>(workspace), *batch, blocks);
195 return 0;
196 } catch (const std::exception& failure) {
197 report(error, capacity, failure.what());
198 } catch (...) {
199 report(error, capacity, "unknown GPU environment error");
200 }
201 return 1;
202}
Eigen::VectorXd assemble(const DeviceEnvironments &left_environments, const DeviceEnvironments &right_environments, const gpr::detail::EnvironmentPairBatch &batch, std::size_t scratch_bytes)

◆ gpr_stdpar_environment_create_v1()

void * gpr_stdpar_environment_create_v1 ( char * error,
std::size_t capacity )
noexcept

Definition at line 169 of file EnvironmentStdparGpu.cpp.

171{
172 try {
173 return new Workspace;
174 } catch (const std::exception& failure) {
175 report(error, capacity, failure.what());
176 } catch (...) {
177 report(error, capacity, "unknown GPU workspace error");
178 }
179 return nullptr;
180}

◆ gpr_stdpar_environment_destroy_v1()

void gpr_stdpar_environment_destroy_v1 ( void * workspace)
noexcept

Definition at line 182 of file EnvironmentStdparGpu.cpp.

183{
184 delete static_cast<Workspace*>(workspace);
185}