Skip to content

Commit

Permalink
Check context validity in clGetContextInfo (#540)
Browse files Browse the repository at this point in the history
Also update clspv

Change-Id: I4c07e37f78f342fc093ec11acfa102c3e98e9328

Signed-off-by: Kévin Petit <[email protected]>
  • Loading branch information
kpet authored Jun 2, 2023
1 parent b4f0d81 commit 6e56af5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,10 @@ cl_int CLVK_API_CALL clGetContextInfo(cl_context ctx,
cl_uint val_uint;
cl_device_id val_device;

if (!is_valid_context(ctx)) {
return CL_INVALID_CONTEXT;
}

auto context = icd_downcast(ctx);

switch (param_name) {
Expand Down
16 changes: 12 additions & 4 deletions tests/conformance/results-amd-7950x.json
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,18 @@
"retcode": 0
},
"Multiple Device/Context": {
"duration": "00:00:17.709432",
"has_results": false,
"results": {},
"retcode": -11
"duration": "00:00:18.810158",
"has_results": true,
"results": {
"context_four_contexts_same_device": "pass",
"context_multiple_contexts_same_device": "pass",
"context_three_contexts_same_device": "pass",
"context_two_contexts_same_device": "pass",
"hundred_queues": "pass",
"max_devices": "fail",
"two_devices": "fail"
},
"retcode": 1
},
"Non-uniform work-group": {
"duration": "00:00:02.682949",
Expand Down
16 changes: 12 additions & 4 deletions tests/conformance/results-intel-a750.json
Original file line number Diff line number Diff line change
Expand Up @@ -1025,10 +1025,18 @@
"retcode": 0
},
"Multiple Device/Context": {
"duration": "00:00:22.184337",
"has_results": false,
"results": {},
"retcode": -11
"duration": "00:00:22.633599",
"has_results": true,
"results": {
"context_four_contexts_same_device": "pass",
"context_multiple_contexts_same_device": "pass",
"context_three_contexts_same_device": "pass",
"context_two_contexts_same_device": "pass",
"hundred_queues": "pass",
"max_devices": "fail",
"two_devices": "fail"
},
"retcode": 1
},
"Non-uniform work-group": {
"duration": "00:00:02.930478",
Expand Down

0 comments on commit 6e56af5

Please sign in to comment.