From a63925256ec38cf38e9928df067bac9781d21d91 Mon Sep 17 00:00:00 2001 From: Inderpreet Singh Date: Thu, 25 Aug 2011 02:04:43 -0800 Subject: Fix for Bug 109 - memory alignment should be 256 bytes. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 10090] --- libopencl/opencl_runtime_api.cc | 1 + src/cuda-sim/cuda-sim.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc index 476e869..f9c1515 100644 --- a/libopencl/opencl_runtime_api.cc +++ b/libopencl/opencl_runtime_api.cc @@ -1134,6 +1134,7 @@ clGetDeviceInfo(cl_device_id device, case CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: CL_INT_CASE(1); break; case CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: CL_INT_CASE(0); break; case CL_DEVICE_SINGLE_FP_CONFIG: CL_INT_CASE(0); break; + case CL_DEVICE_MEM_BASE_ADDR_ALIGN: CL_INT_CASE(256*8); break; default: opencl_not_implemented(__my_func__,__LINE__); } diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc index e7667b2..e3e0245 100644 --- a/src/cuda-sim/cuda-sim.cc +++ b/src/cuda-sim/cuda-sim.cc @@ -324,7 +324,7 @@ void* gpgpu_t::gpu_malloc( size_t size ) fflush(stdout); } m_dev_malloc += size; - if (size%64) m_dev_malloc += (64 - size%64); //align to 64 byte boundaries + if (size%256) m_dev_malloc += (256 - size%256); //align to 256 byte boundaries return(void*) result; } @@ -336,7 +336,7 @@ void* gpgpu_t::gpu_mallocarray( size_t size ) fflush(stdout); } m_dev_malloc += size; - if (size%64) m_dev_malloc += (64 - size%64); //align to 64 byte boundaries + if (size%256) m_dev_malloc += (256 - size%256); //align to 256 byte boundaries return(void*) result; } -- cgit v1.3