diff --git a/hipamd/src/hip_platform.cpp b/hipamd/src/hip_platform.cpp index 10b8d3f894..1624e080b0 100644 --- a/hipamd/src/hip_platform.cpp +++ b/hipamd/src/hip_platform.cpp @@ -443,6 +443,9 @@ hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int* if ((gridSize == nullptr) || (blockSize == nullptr)) { HIP_RETURN(hipErrorInvalidValue); } + if (flags != hipOccupancyDefault && flags != hipOccupancyDisableCachingOverride) { + HIP_RETURN(hipErrorInvalidValue); + } const amd::Device& device = *hip::getCurrentDevice()->devices()[0]; int max_blocks_per_grid = 0; int num_blocks = 0; @@ -484,6 +487,9 @@ hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags( if (numBlocks == nullptr) { HIP_RETURN(hipErrorInvalidValue); } + if (flags != hipOccupancyDefault && flags != hipOccupancyDisableCachingOverride) { + HIP_RETURN(hipErrorInvalidValue); + } const amd::Device& device = *hip::getCurrentDevice()->devices()[0]; int num_blocks = 0;