Skip to content

Commit 46206fa

Browse files
committed
Wrap calls to occupancy api with error checking macros
1 parent 3432262 commit 46206fa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/flamegpu/simulation/CUDASimulation.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void CUDASimulation::spatialSortAgent_async(const std::string& funcName, const s
500500
int blockSize = 0; // The launch configurator returned block size
501501
int minGridSize = 0; // The minimum grid size needed to achieve the // maximum occupancy for a full device // launch
502502
int gridSize = 0; // The actual grid size needed, based on input size
503-
cudaOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, calculateSpatialHash, 0, state_list_size);
503+
gpuErrchk(cudaOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, calculateSpatialHash, 0, state_list_size));
504504

505505
//! Round up according to CUDAAgent state list size
506506
gridSize = (state_list_size + blockSize - 1) / blockSize;
@@ -734,7 +734,7 @@ void CUDASimulation::stepLayer(const std::shared_ptr<LayerData>& layer, const un
734734
// switch between normal and RTC agent function condition
735735
if (func_des->condition) {
736736
// calculate the grid block size for agent function condition
737-
cudaOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, func_des->condition, 0, state_list_size);
737+
gpuErrchk(cudaOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, func_des->condition, 0, state_list_size));
738738

739739
//! Round up according to CUDAAgent state list size
740740
gridSize = (state_list_size + blockSize - 1) / blockSize;
@@ -756,7 +756,7 @@ void CUDASimulation::stepLayer(const std::shared_ptr<LayerData>& layer, const un
756756
const jitify2::KernelData& instance = cuda_agent.getRTCInstantiation(func_condition_identifier);
757757
// calculate the grid block size for main agent function
758758
CUfunction cu_func = (CUfunction)instance.function();
759-
cuOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, cu_func, 0, 0, state_list_size);
759+
gpuErrchkDriverAPI(cuOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, cu_func, 0, 0, state_list_size));
760760
//! Round up according to CUDAAgent state list size
761761
gridSize = (state_list_size + blockSize - 1) / blockSize;
762762
// launch the kernel
@@ -984,7 +984,7 @@ void CUDASimulation::stepLayer(const std::shared_ptr<LayerData>& layer, const un
984984
const jitify2::KernelData& instance = cuda_agent.getRTCInstantiation(func_name);
985985
// calculate the grid block size for main agent function
986986
CUfunction cu_func = (CUfunction)instance.function();
987-
cuOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, cu_func, 0, 0, state_list_size);
987+
gpuErrchkDriverAPI(cuOccupancyMaxPotentialBlockSize(&minGridSize, &blockSize, cu_func, 0, 0, state_list_size));
988988
//! Round up according to CUDAAgent state list size
989989
gridSize = (state_list_size + blockSize - 1) / blockSize;
990990
// launch the kernel

0 commit comments

Comments
 (0)