summaryrefslogtreecommitdiff
path: root/libcuda
diff options
context:
space:
mode:
authorSuchita Pati <[email protected]>2019-04-16 23:36:02 -0500
committerSuchita Pati <[email protected]>2019-04-16 23:36:02 -0500
commit69af057daf1999f17b81d761c7a616f67f56adbb (patch)
tree8e660ea7c5f11cf594c9a76513f8c1b6c01f3aeb /libcuda
parent73050b730b31e9f58f8c2a0bfc4b3a8cd92be7ff (diff)
Adding additional fixes for the texture bugs
Diffstat (limited to 'libcuda')
-rw-r--r--libcuda/cuda_runtime_api.cc22
1 files changed, 12 insertions, 10 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index 7569b20..f6e5e6f 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1121,10 +1121,10 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetAttribute(int *value, enum cudaDevic
*value= 0;
break;
case 75:
- *value= 9 ;
+ *value= 7 ;
break;
case 76:
- *value= 3 ;
+ *value= 0 ;
break;
case 78:
*value= 0 ; //TODO: as of now, we dont support stream priorities.
@@ -1199,22 +1199,23 @@ __host__ cudaError_t CUDARTAPI cudaGetDevice(int *device)
*device = g_active_device;
return g_last_cudaError = cudaSuccess;
}
+
__host__ cudaError_t CUDARTAPI cudaDeviceGetLimit ( size_t* pValue, cudaLimit limit )
{
if(g_debug_execution >= 3){
announce_call(__my_func__);
}
switch(limit) {
- case 0:
+ case 0: // cudaLimitStackSize
*pValue=1024;
break;
- case 2:
+ case 2: // cudaLimitMallocHeapSize
*pValue=8388608;
break;
- case 3:
+ case 3: // cudaLimitDevRuntimeSyncDepth
*pValue=2;
break;
- case 4:
+ case 4: // cudaLimitDevRuntimePendingLaunchCount
*pValue=2048;
break;
default:
@@ -1225,7 +1226,6 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetLimit ( size_t* pValue, cudaLimit li
}
-
__host__ cudaError_t CUDARTAPI cudaStreamGetPriority ( cudaStream_t hStream, int* priority )
{
if(g_debug_execution >= 3){
@@ -1585,7 +1585,7 @@ __host__ cudaError_t CUDARTAPI cudaStreamDestroy(cudaStream_t stream)
announce_call(__my_func__);
}
#if (CUDART_VERSION >= 3000)
- //synchronization required for application using external libraries without explicit synchronization in the code to
+ //per-stream synchronization required for application using external libraries without explicit synchronization in the code to
//avoid the stream_manager from spinning forever to destroy non-empty streams without making any forward progress.
stream->synchronize();
g_stream_manager->destroy_stream(stream);
@@ -2714,7 +2714,6 @@ cudaError_t cudaDeviceReset ( void ) {
return g_last_cudaError = cudaSuccess;
}
cudaError_t CUDARTAPI cudaDeviceSynchronize(void){
- // I don't know what this should do
if(g_debug_execution >= 3){
announce_call(__my_func__);
}
@@ -2722,7 +2721,6 @@ cudaError_t CUDARTAPI cudaDeviceSynchronize(void){
return g_last_cudaError = cudaSuccess;
}
-
void CUDARTAPI __cudaRegisterFunction(
void **fatCubinHandle,
const char *hostFun,
@@ -3333,6 +3331,10 @@ kernel_info_t *gpgpu_cuda_ptx_sim_init_grid( const char *hostFun,
}
function_info *entry = context->get_kernel(hostFun);
gpgpu_t* gpu= context->get_device()->get_gpgpu();
+ /*
+ Passing a snapshot of the GPU's current texture mapping to the kernel's info
+ as kernels should use texture bindings present at the time of their launch.
+ */
kernel_info_t *result = new kernel_info_t(gridDim,blockDim,entry,gpu->getNameArrayMapping(),gpu->getNameInfoMapping());
if( entry == NULL ) {
printf("GPGPU-Sim PTX: ERROR launching kernel -- no PTX implementation found for %p\n", hostFun);