Skip to content

Commit 009198e

Browse files
committed
libopencl: Calculate a valid offset in bind_args()
Signed-off-by: Roy Spliet <rs855@cam.ac.uk>
1 parent ae2a0f2 commit 009198e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libopencl/opencl_runtime_api.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,16 @@ void _cl_kernel::SetKernelArg(
263263

264264
cl_int _cl_kernel::bind_args( gpgpu_ptx_sim_arg_list_t &arg_list )
265265
{
266+
size_t offset = 0;
266267
assert( arg_list.empty() );
267268
unsigned k=0;
268269
std::map<unsigned, arg_info>::iterator i;
269270
for( i = m_args.begin(); i!=m_args.end(); i++ ) {
270271
if( i->first != k )
271272
return CL_INVALID_KERNEL_ARGS;
272273
arg_info arg = i->second;
273-
gpgpu_ptx_sim_arg param( arg.m_arg_value, arg.m_arg_size, 0);
274+
gpgpu_ptx_sim_arg param( arg.m_arg_value, arg.m_arg_size, offset );
275+
offset += arg.m_arg_size;
274276
arg_list.push_front( param );
275277
k++;
276278
}

0 commit comments

Comments
 (0)