Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tonyrog/cl
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyrog committed Jan 3, 2019
2 parents fdf1edf + b8ada50 commit a80904c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions c_src/cl_nif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,11 +1879,11 @@ ecl_kv_t kv_type_qualifier[] = {
};

ecl_info_t arg_info[] = {
{ &ATOM(address_qualifier), CL_KERNEL_ARG_ADDRESS_QUALIFIER, false, OCL_ENUM, kv_address_qualifier },
{ &ATOM(access_qualifier), CL_KERNEL_ARG_ACCESS_QUALIFIER, false, OCL_ENUM, kv_access_qualifier },
{ &ATOM(type_name), CL_KERNEL_ARG_TYPE_NAME, false, OCL_STRING, 0 },
{ &ATOM(type_qualifier), CL_KERNEL_ARG_TYPE_QUALIFIER, false, OCL_ENUM, kv_type_qualifier },
{ &ATOM(name), CL_KERNEL_ARG_NAME, false, OCL_STRING, 0 },
{ &ATOM(address_qualifier), CL_KERNEL_ARG_ADDRESS_QUALIFIER, false, OCL_ENUM, kv_address_qualifier, 0 },
{ &ATOM(access_qualifier), CL_KERNEL_ARG_ACCESS_QUALIFIER, false, OCL_ENUM, kv_access_qualifier, 0 },
{ &ATOM(type_name), CL_KERNEL_ARG_TYPE_NAME, false, OCL_STRING, 0, 0 },
{ &ATOM(type_qualifier), CL_KERNEL_ARG_TYPE_QUALIFIER, false, OCL_ENUM, kv_type_qualifier, 0 },
{ &ATOM(name), CL_KERNEL_ARG_NAME, false, OCL_STRING, 0, 0 },
};
#endif

Expand Down
11 changes: 9 additions & 2 deletions src/cl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1844,8 +1844,15 @@ get_kernel_arg_info(Kernel) ->
{ok, N} ->
{ok,
lists:map(fun(I) ->
{ok,Info} = get_kernel_arg_info(Kernel, I),
{I,Info}
try get_kernel_arg_info(Kernel, I) of
{ok,Info} ->
{I,Info};
{error,Reason} ->
{I,{error,Reason}}
catch
error:Reason ->
{I,{error,Reason}}
end
end, lists:seq(0, N-1))};
Error ->
Error
Expand Down
2 changes: 1 addition & 1 deletion test/cl_basic.erl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ __kernel void program1(int n, int m) {
build_info(Program, Device)
end, DeviceList),

case cl:build_program(Program, DeviceList, "-Dhello=1 -Dtest") of
case cl:build_program(Program, DeviceList, "-Dhello=1 -Dtest -cl-kernel-arg-info") of
ok ->
foreach(
fun(Device) ->
Expand Down

0 comments on commit a80904c

Please sign in to comment.