summaryrefslogtreecommitdiff
path: root/libcuda
diff options
context:
space:
mode:
authortgrogers <[email protected]>2019-06-10 09:19:30 -0400
committertgrogers <[email protected]>2019-06-10 09:19:30 -0400
commit2ea18072618e7fe4e541f84de7d8575998299a1c (patch)
tree6b58b6bcbfc7eea733ca9c1318f7a17769b5bd5c /libcuda
parent8a6d828b9adfe8bf690f671e9fc5902315b030b7 (diff)
Code to get CUDA 10 to work - looks like the gridDim/blockDim args given to cudaLaunchKernel are not complete garbage. We must rely on the PushConfig to get the proper sizing info
Diffstat (limited to 'libcuda')
-rw-r--r--libcuda/cuda_runtime_api.cc43
1 files changed, 27 insertions, 16 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index 718db49..500b5f2 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -2108,20 +2108,21 @@ __host__ cudaError_t CUDARTAPI cudaLaunch( const char *hostFun )
__host__ cudaError_t CUDARTAPI cudaLaunchKernel ( const char* hostFun, dim3 gridDim, dim3 blockDim, const void** args, size_t sharedMem, cudaStream_t stream )
{
- if(g_debug_execution >= 3){
- announce_call(__my_func__);
- }
- CUctx_st *context = GPGPUSim_Context();
- function_info *entry = context->get_kernel(hostFun);
-
- cudaConfigureCallInternal(gridDim, blockDim, sharedMem, stream);
- for(unsigned i = 0; i < entry->num_args(); i++){
- std::pair<size_t, unsigned> p = entry->get_param_config(i);
- cudaSetupArgumentInternal(args[i], p.first, p.second);
- }
+ if(g_debug_execution >= 3){
+ announce_call(__my_func__);
+ }
+ CUctx_st *context = GPGPUSim_Context();
+ function_info *entry = context->get_kernel(hostFun);
+#if CUDART_VERSION < 10000
+ cudaConfigureCallInternal(gridDim, blockDim, sharedMem, stream);
+#endif
+ for(unsigned i = 0; i < entry->num_args(); i++){
+ std::pair<size_t, unsigned> p = entry->get_param_config(i);
+ cudaSetupArgumentInternal(args[i], p.first, p.second);
+ }
- cudaLaunchInternal(hostFun);
- return g_last_cudaError = cudaSuccess;
+ cudaLaunchInternal(hostFun);
+ return g_last_cudaError = cudaSuccess;
}
@@ -2974,12 +2975,17 @@ extern "C" {
void** CUDARTAPI __cudaRegisterFatBinary( void *fatCubin )
{
+ if(g_debug_execution >= 3){
+ announce_call(__my_func__);
+ }
return cudaRegisterFatBinaryInternal(fatCubin);
}
void CUDARTAPI __cudaRegisterFatBinaryEnd( void **fatCubinHandle )
{
-
+ if(g_debug_execution >= 3){
+ announce_call(__my_func__);
+ }
}
unsigned CUDARTAPI __cudaPushCallConfiguration(dim3 gridDim,
@@ -2987,7 +2993,10 @@ unsigned CUDARTAPI __cudaPushCallConfiguration(dim3 gridDim,
size_t sharedMem = 0,
struct CUstream_st *stream = 0)
{
-
+ if(g_debug_execution >= 3){
+ announce_call(__my_func__);
+ }
+ cudaConfigureCallInternal(gridDim, blockDim, sharedMem, stream);
}
cudaError_t CUDARTAPI __cudaPopCallConfiguration(
@@ -2997,6 +3006,9 @@ cudaError_t CUDARTAPI __cudaPopCallConfiguration(
void *stream
)
{
+ if(g_debug_execution >= 3){
+ announce_call(__my_func__);
+ }
return g_last_cudaError = cudaSuccess;
}
@@ -3056,7 +3068,6 @@ void __cudaUnregisterFatBinary(void **fatCubinHandle)
if(g_debug_execution >= 3){
announce_call(__my_func__);
}
- ;
}
cudaError_t cudaDeviceReset ( void ) {