[HIP] Reclaiming hipLaunchKernel API (#1353)

* [HIP] Reclaiming hipLaunchKernel API

* Reclaiming hipLaunchKernel : Incorporated review comments

* Incorporated review comments

* Removed hipLaunchKernel Macro from nvcc path
Ta zmiana jest zawarta w:
Sarbojit2019 authored and Maneesh Gupta committed 2019-08-29 01:02:41 +00:00
1 rodzic d2df21e58c
złożenie 1ae43cbeba
8 plików zmienionych
+297 -14

Żadne pliki nie pasują do Twojego wyszukiwania

+28
Wyświetl plik
@@ -1238,3 +1238,31 @@ hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
return ihipLogStatus(ihipOccupancyMaxActiveBlocksPerMultiprocessor(
tls, numBlocks, f, blockSize, dynSharedMemPerBlk));
}
hipError_t hipLaunchKernel(
const void* func_addr, dim3 numBlocks, dim3 dimBlocks, void** args,
size_t sharedMemBytes, hipStream_t stream)
{
HIP_INIT_API(hipLaunchKernel,func_addr,numBlocks,dimBlocks,args,sharedMemBytes,stream);
hipFunction_t kd = hip_impl::get_program_state().kernel_descriptor((std::uintptr_t)func_addr,
hip_impl::target_agent(stream));
if(kd == nullptr || kd->_header == nullptr)
return ihipLogStatus(hipErrorInvalidValue);
size_t szKernArg = kd->_header->kernarg_segment_byte_size;
if(args == NULL && szKernArg != 0)
return ihipLogStatus(hipErrorInvalidValue);
void* config[]{
HIP_LAUNCH_PARAM_BUFFER_POINTER,
args,
HIP_LAUNCH_PARAM_BUFFER_SIZE,
&szKernArg,
HIP_LAUNCH_PARAM_END};
return ihipLogStatus(ihipModuleLaunchKernel(tls, kd, numBlocks.x * dimBlocks.x, numBlocks.y * dimBlocks.y, numBlocks.z * dimBlocks.z,
dimBlocks.x, dimBlocks.y, dimBlocks.z, sharedMemBytes, stream, nullptr, (void**)&config, nullptr, nullptr, 0));
}