diff options
| author | Tor Aamodt <[email protected]> | 2010-08-23 23:27:25 -0800 |
|---|---|---|
| committer | Tor Aamodt <[email protected]> | 2010-08-23 23:27:25 -0800 |
| commit | 7858517a1e387572e1223eb186f2721458e6bbb3 (patch) | |
| tree | 66a8c26b386c46b3efd15711db33e9fad79e5422 /libopencl/opencl_runtime_api.cc | |
| parent | 5e8eced64a8262b0190c4014e59b93c37ba3af9c (diff) | |
- oclMatrixMul passing (added support for dynamically allocating shared memory on kernel launch for OpenCL)
- added some debugging printfs to oclMatrixMul
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 7255]
Diffstat (limited to 'libopencl/opencl_runtime_api.cc')
| -rw-r--r-- | libopencl/opencl_runtime_api.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc index a932738..365f8cf 100644 --- a/libopencl/opencl_runtime_api.cc +++ b/libopencl/opencl_runtime_api.cc @@ -361,16 +361,19 @@ _cl_mem::_cl_mem( return; } if( flags & CL_MEM_ALLOC_HOST_PTR ) - gpgpusim_opencl_error(__my_func__,__LINE__," CL_MEM_ALLOC_HOST_PTR -- not yet supported.\n"); + gpgpusim_opencl_error(__my_func__,__LINE__," CL_MEM_ALLOC_HOST_PTR -- not yet supported/tested.\n"); - if( flags & CL_MEM_USE_HOST_PTR ) { + if( flags & (CL_MEM_USE_HOST_PTR|CL_MEM_ALLOC_HOST_PTR) ) { m_is_on_host = true; } else { m_is_on_host = false; } - 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 ); + if( !(flags & (CL_MEM_USE_HOST_PTR|CL_MEM_ALLOC_HOST_PTR)) ) { + // if not allocating on host, then allocate GPU memory and make a copy + 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 ); + } } cl_mem _cl_context::CreateBuffer( |
