aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGil Pitney <gil.pitney@linaro.org>2015-10-02 00:39:58 +0000
committerGil Pitney <gil.pitney@linaro.org>2015-10-02 00:39:58 +0000
commitf5470379da8e7451a4acfedaaea65f6a1c5f28d3 (patch)
tree36e5ebe26b12accce2c9e425a028c6f6aa21c125
parent5e6a3c0c70334bd7aaad543bddba99a29e8c51f5 (diff)
downloadshamrock-f5470379da8e7451a4acfedaaea65f6a1c5f28d3.tar.gz
ICD: Update Sampler objects to be ICD compatible.
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r--src/api/api_sampler.cpp14
-rw-r--r--src/core/sampler.h12
2 files changed, 18 insertions, 8 deletions
diff --git a/src/api/api_sampler.cpp b/src/api/api_sampler.cpp
index 6bee50e..08e5d1c 100644
--- a/src/api/api_sampler.cpp
+++ b/src/api/api_sampler.cpp
@@ -71,12 +71,14 @@ clCreateSampler(cl_context d_context,
return 0;
}
- return (cl_sampler)sampler;
+ return desc(sampler);
}
cl_int
-clRetainSampler(cl_sampler sampler)
+clRetainSampler(cl_sampler d_sampler)
{
+ auto sampler = pobj(d_sampler);
+
if (!sampler->isA(Coal::Object::T_Sampler))
return CL_INVALID_SAMPLER;
@@ -86,8 +88,10 @@ clRetainSampler(cl_sampler sampler)
}
cl_int
-clReleaseSampler(cl_sampler sampler)
+clReleaseSampler(cl_sampler d_sampler)
{
+ auto sampler = pobj(d_sampler);
+
if (!sampler->isA(Coal::Object::T_Sampler))
return CL_INVALID_SAMPLER;
@@ -98,12 +102,14 @@ clReleaseSampler(cl_sampler sampler)
}
cl_int
-clGetSamplerInfo(cl_sampler sampler,
+clGetSamplerInfo(cl_sampler d_sampler,
cl_sampler_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret)
{
+ auto sampler = pobj(d_sampler);
+
if (!sampler->isA(Coal::Object::T_Sampler))
return CL_INVALID_SAMPLER;
diff --git a/src/core/sampler.h b/src/core/sampler.h
index 1ff1f1f..2e3c0fe 100644
--- a/src/core/sampler.h
+++ b/src/core/sampler.h
@@ -35,6 +35,7 @@
#include <CL/cl.h>
#include "object.h"
+#include "icd.h"
// WARNING: Keep in sync with stdlib.h
@@ -54,6 +55,12 @@
namespace Coal
{
+ class Sampler;
+}
+struct _cl_sampler: public Coal::descriptor<Coal::Sampler, _cl_sampler> {};
+
+namespace Coal
+{
class Context;
@@ -64,7 +71,7 @@ class Context;
* host OpenCL constants to constants that will be used by the kernels and
* the image reading and writing built-in functions.
*/
-class Sampler : public Object
+class Sampler : public _cl_sampler, public Object
{
public:
/**
@@ -109,7 +116,4 @@ class Sampler : public Object
}
-struct _cl_sampler : public Coal::Sampler
-{};
-
#endif