From 83a96bb39177a0767c6d851f4fe3ff92757652f5 Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 12 Aug 2010 19:35:44 -0800 Subject: - allow multiple clCreateBuffer wth same host_ptr (undefined behavior in OpenCL spec, but required for oclTranspose). - undo earlier fix that wasn't a fix [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7194] --- libopencl/opencl_runtime_api.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libopencl') diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc index b886f90..054d517 100644 --- a/libopencl/opencl_runtime_api.cc +++ b/libopencl/opencl_runtime_api.cc @@ -371,7 +371,6 @@ _cl_mem::_cl_mem( m_device_ptr = (size_t) gpgpu_ptx_sim_malloc(size); if( host_ptr ) gpgpu_ptx_sim_memcpy_to_gpu( m_device_ptr, host_ptr, size ); - *errcode_ret = CL_SUCCESS; } cl_mem _cl_context::CreateBuffer( @@ -381,9 +380,7 @@ cl_mem _cl_context::CreateBuffer( cl_int * errcode_ret ) { if( host_ptr && (m_hostptr_to_cl_mem.find(host_ptr) != m_hostptr_to_cl_mem.end()) ) { - printf("GPGPU-Sim OpenCL API: clCreateBuffer - buffer already created for this host variable\n"); - *errcode_ret = CL_MEM_OBJECT_ALLOCATION_FAILURE; - return NULL; + printf("GPGPU-Sim OpenCL API: WARNING ** clCreateBuffer - buffer already created for this host variable\n"); } cl_mem result = new _cl_mem(flags,size,host_ptr,errcode_ret); m_devptr_to_cl_mem[result->device_ptr()] = result; -- cgit v1.3