diff options
author | Francisco Jerez <[email protected]> | 2013-09-16 21:38:32 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-10-21 10:47:03 -0700 |
commit | 10284b1d2d3f59c2d54b8c975c400be29548e0cc (patch) | |
tree | 4f8a759488094c86520ec0d6e8e0437fc614b8b6 /src/gallium/state_trackers/clover/api | |
parent | 5226eacf8d4ea395062bf594079acc747bcd6e97 (diff) |
clover: Clean up the interface of the context object slightly.
Tested-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover/api')
-rw-r--r-- | src/gallium/state_trackers/clover/api/context.cpp | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/clover/api/program.cpp | 12 | ||||
-rw-r--r-- | src/gallium/state_trackers/clover/api/queue.cpp | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/clover/api/context.cpp b/src/gallium/state_trackers/clover/api/context.cpp index 98bc2141e11..c6c71ceb92f 100644 --- a/src/gallium/state_trackers/clover/api/context.cpp +++ b/src/gallium/state_trackers/clover/api/context.cpp @@ -111,11 +111,11 @@ clGetContextInfo(cl_context d_ctx, cl_context_info param, break; case CL_CONTEXT_NUM_DEVICES: - buf.as_scalar<cl_uint>() = ctx.devs.size(); + buf.as_scalar<cl_uint>() = ctx.devs().size(); break; case CL_CONTEXT_DEVICES: - buf.as_vector<cl_device_id>() = descs(map(derefs(), ctx.devs)); + buf.as_vector<cl_device_id>() = descs(ctx.devs()); break; case CL_CONTEXT_PROPERTIES: diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index 84260472953..45640424a0d 100644 --- a/src/gallium/state_trackers/clover/api/program.cpp +++ b/src/gallium/state_trackers/clover/api/program.cpp @@ -63,8 +63,8 @@ clCreateProgramWithBinary(cl_context d_ctx, cl_uint n, if (!lengths || !binaries) throw error(CL_INVALID_VALUE); - if (any_of([&](device &dev) { - return !ctx.has_device(dev); + if (any_of([&](const device &dev) { + return !count(dev, ctx.devs()); }, devs)) throw error(CL_INVALID_DEVICE); @@ -133,15 +133,15 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs, void *user_data) try { auto &prog = obj(d_prog); auto devs = (d_devs ? objs(d_devs, num_devs) : - ref_vector<device>(map(derefs(), prog.ctx.devs))); + ref_vector<device>(prog.ctx.devs())); auto opts = (p_opts ? p_opts : ""); if (bool(num_devs) != bool(d_devs) || (!pfn_notify && user_data)) throw error(CL_INVALID_VALUE); - if (any_of([&](device &dev) { - return !prog.ctx.has_device(dev); + if (any_of([&](const device &dev) { + return !count(dev, prog.ctx.devs()); }, devs)) throw error(CL_INVALID_DEVICE); @@ -224,7 +224,7 @@ clGetProgramBuildInfo(cl_program d_prog, cl_device_id d_dev, auto &prog = obj(d_prog); auto &dev = obj(d_dev); - if (!prog.ctx.has_device(dev)) + if (!count(dev, prog.ctx.devs())) return CL_INVALID_DEVICE; switch (param) { diff --git a/src/gallium/state_trackers/clover/api/queue.cpp b/src/gallium/state_trackers/clover/api/queue.cpp index b68dfa1f62a..0fdb7356b35 100644 --- a/src/gallium/state_trackers/clover/api/queue.cpp +++ b/src/gallium/state_trackers/clover/api/queue.cpp @@ -32,7 +32,7 @@ clCreateCommandQueue(cl_context d_ctx, cl_device_id d_dev, auto &ctx = obj(d_ctx); auto &dev = obj(d_dev); - if (!ctx.has_device(dev)) + if (!count(dev, ctx.devs())) throw error(CL_INVALID_DEVICE); if (props & ~(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | |