MCPcopy Create free account
hub / github.com/ROCm/clr / hipModuleOccupancyMaxPotentialBlockSize

Function hipModuleOccupancyMaxPotentialBlockSize

hipamd/src/hip_platform.cpp:545–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize, hipFunction_t f,
546 size_t dynSharedMemPerBlk, int blockSizeLimit) {
547 HIP_INIT_API(hipModuleOccupancyMaxPotentialBlockSize, f, dynSharedMemPerBlk, blockSizeLimit);
548 if ((gridSize == nullptr) || (blockSize == nullptr) || (f == nullptr)) {
549 HIP_RETURN(hipErrorInvalidValue);
550 }
551 const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
552 int max_blocks_per_grid = 0;
553 int num_blocks = 0;
554 int best_block_size = 0;
555 hipError_t ret = hip_impl::ihipOccupancyMaxActiveBlocksPerMultiprocessor(
556 &num_blocks, &max_blocks_per_grid, &best_block_size, device, f, blockSizeLimit,
557 dynSharedMemPerBlk, true);
558 if (ret == hipSuccess) {
559 *blockSize = best_block_size;
560 *gridSize = max_blocks_per_grid;
561 }
562 HIP_RETURN(ret);
563}
564
565hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* blockSize,
566 hipFunction_t f,

Tested by

no test coverage detected