P4 to Git Change 2045076 by skudchad@skudchad_test2_win_opencl on 2019/12/12 15:57:20

SWDEV-213031 - Check the functions_ map else interpret as a hip::Function for now. Function may not be a device function and may have been obtaiend via hipModuleGetFunction and thus not in the functions_ map

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/18388/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#57 edit
This commit is contained in:
foreman
2019-12-12 16:01:14 -05:00
rodzic 5fd041aca7
commit 35e0c1b6c4
+9 -3
Wyświetl plik
@@ -626,12 +626,17 @@ hipError_t ihipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
{
HIP_INIT_API(NONE, f, blockSize, dynamicSMemSize);
int deviceId = ihipGetDevice();
// FIXME: Function may not be a device function and may have been obtaiend via
// hipModuleGetFunction and thus not in the functions_ map. Check the map
// else interpret as a hip::Function for now.
hipFunction_t func = PlatformState::instance().getFunc(f, deviceId);
if (func == nullptr) {
func = f;
}
hip::Function* function = hip::Function::asFunction(func);
if (function == nullptr) {
HIP_RETURN(hipErrorInvalidDeviceFunction);
}
hip::Function* function = hip::Function::asFunction(func);
amd::Kernel* kernel = function->function_;
if (!kernel) {
HIP_RETURN(hipErrorOutOfMemory);
@@ -890,8 +895,9 @@ const std::unordered_map<uintptr_t, hipFunction_t>& functions()
for (auto&& function : function_names()) {
for (auto&& module : modules()) {
hipFunction_t f;
if (hipSuccess == hipModuleGetFunction(&f, module, function.second.c_str()))
if (hipSuccess == hipModuleGetFunction(&f, module, function.second.c_str())) {
r[function.first] = f;
}
}
}
});