[Pkg-opencl-devel] [beignet] 19/66: Imported Upstream version 0.1+git20130426+0c8f6fe
Andreas Beckmann
anbe at moszumanska.debian.org
Fri Oct 31 07:27:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch master
in repository beignet.
commit a0a29808192357bd3dbbc46d7268f6ef09375757
Author: Simon Richter <sjr at debian.org>
Date: Fri Apr 26 14:42:21 2013 +0200
Imported Upstream version 0.1+git20130426+0c8f6fe
---
backend/src/ir/profile.cpp | 1 +
backend/src/ocl_stdlib.h | 15 ++++++++++++-
src/cl_device_id.c | 54 ++++++++++++++++++++++------------------------
src/cl_device_id.h | 2 ++
src/cl_gt_device.h | 1 +
src/cl_platform_id.h | 7 ++++--
6 files changed, 49 insertions(+), 31 deletions(-)
diff --git a/backend/src/ir/profile.cpp b/backend/src/ir/profile.cpp
index 55a2492..61531be 100644
--- a/backend/src/ir/profile.cpp
+++ b/backend/src/ir/profile.cpp
@@ -39,6 +39,7 @@ namespace ir {
"global_offset_0", "global_offset_1", "global_offset_2",
"stack_pointer",
"block_ip",
+ "barrier_id", "thread_number",
};
#if GBE_DEBUG
diff --git a/backend/src/ocl_stdlib.h b/backend/src/ocl_stdlib.h
index 5c9b766..79616b8 100644
--- a/backend/src/ocl_stdlib.h
+++ b/backend/src/ocl_stdlib.h
@@ -1,5 +1,5 @@
/*
-uint* Copyright © 2012 Intel Corporation
+ * Copyright © 2012 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -438,15 +438,24 @@ INLINE OVERLOADABLE float mad(float a, float b, float c) {
return a*b+c;
}
+INLINE OVERLOADABLE uint select(uint src0, uint src1, int cond) {
+ return cond ? src1 : src0;
+}
INLINE OVERLOADABLE uint select(uint src0, uint src1, uint cond) {
return cond ? src1 : src0;
}
INLINE OVERLOADABLE int select(int src0, int src1, int cond) {
return cond ? src1 : src0;
}
+INLINE OVERLOADABLE int select(int src0, int src1, uint cond) {
+ return cond ? src1 : src0;
+}
INLINE OVERLOADABLE float select(float src0, float src1, int cond) {
return cond ? src1 : src0;
}
+INLINE OVERLOADABLE float select(float src0, float src1, uint cond) {
+ return cond ? src1 : src0;
+}
// This will be optimized out by LLVM and will output LLVM select instructions
#define DECL_SELECT4(TYPE4, TYPE, COND_TYPE4, MASK) \
@@ -467,7 +476,9 @@ INLINE OVERLOADABLE TYPE4 select(TYPE4 src0, TYPE4 src1, COND_TYPE4 cond) { \
return dst; \
}
DECL_SELECT4(int4, int, int4, 0x80000000)
+DECL_SELECT4(int4, int, uint4, 0x80000000)
DECL_SELECT4(float4, float, int4, 0x80000000)
+DECL_SELECT4(float4, float, uint4, 0x80000000)
#undef DECL_SELECT4
/////////////////////////////////////////////////////////////////////////////
@@ -673,6 +684,8 @@ DECL_VECTOR_1OP(__gen_ocl_internal_log10, float);
}
DECL_VECTOR_2OP(min, float);
DECL_VECTOR_2OP(max, float);
+DECL_VECTOR_2OP(__gen_ocl_internal_fmin, float);
+DECL_VECTOR_2OP(__gen_ocl_internal_fmax, float);
DECL_VECTOR_2OP(fmod, float);
DECL_VECTOR_2OP(powr, float);
#undef DECL_VECTOR_2OP
diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index 9f8e6ad..6300b41 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -135,30 +135,28 @@ cl_get_device_ids(cl_platform_id platform,
#define DECL_FIELD(CASE,FIELD) \
case JOIN(CL_DEVICE_,CASE): \
- if (param_value_size < sizeof(((cl_device_id)NULL)->FIELD)) \
- return CL_INVALID_VALUE; \
- if (param_value_size_ret != NULL) \
- *param_value_size_ret = sizeof(((cl_device_id)NULL)->FIELD);\
- memcpy(param_value, \
- &device->FIELD, \
- sizeof(((cl_device_id)NULL)->FIELD)); \
- return CL_SUCCESS;
+ if (param_value_size_ret) { \
+ *param_value_size_ret = sizeof device->FIELD; \
+ if (!param_value) \
+ return CL_SUCCESS; \
+ } \
+ if (param_value_size < sizeof device->FIELD) \
+ return CL_INVALID_VALUE; \
+ memcpy(param_value, &device->FIELD, sizeof device->FIELD); \
+ return CL_SUCCESS;
#define DECL_STRING_FIELD(CASE,FIELD) \
case JOIN(CL_DEVICE_,CASE): \
+ if (param_value_size_ret) { \
+ *param_value_size_ret = device->JOIN(FIELD,_sz); \
+ if (!param_value) \
+ return CL_SUCCESS; \
+ } \
if (param_value_size < device->JOIN(FIELD,_sz)) \
return CL_INVALID_VALUE; \
- if (param_value_size_ret != NULL) \
- *param_value_size_ret = device->JOIN(FIELD,_sz); \
memcpy(param_value, device->FIELD, device->JOIN(FIELD,_sz)); \
return CL_SUCCESS;
-#define GET_STRING_FIELD_SIZE(CASE,FIELD) \
- case JOIN(CL_DEVICE_,CASE): \
- if (param_value_size_ret != NULL) \
- *param_value_size_ret = device->JOIN(FIELD,_sz); \
- return CL_SUCCESS;
-
LOCAL cl_int
cl_get_device_info(cl_device_id device,
cl_device_info param_name,
@@ -171,18 +169,6 @@ cl_get_device_info(cl_device_id device,
device != &intel_hsw_device))
return CL_INVALID_DEVICE;
- if (param_value == NULL) {
- switch (param_name) {
- GET_STRING_FIELD_SIZE(NAME, name)
- GET_STRING_FIELD_SIZE(VENDOR, vendor)
- GET_STRING_FIELD_SIZE(VERSION, version)
- GET_STRING_FIELD_SIZE(PROFILE, profile)
- GET_STRING_FIELD_SIZE(OPENCL_C_VERSION, opencl_c_version)
- GET_STRING_FIELD_SIZE(EXTENSIONS, extensions)
- default: return CL_INVALID_VALUE;
- }
- }
-
/* Find the correct parameter */
switch (param_name) {
DECL_FIELD(TYPE, device_type)
@@ -244,6 +230,18 @@ cl_get_device_info(cl_device_id device,
DECL_STRING_FIELD(PROFILE, profile)
DECL_STRING_FIELD(OPENCL_C_VERSION, opencl_c_version)
DECL_STRING_FIELD(EXTENSIONS, extensions);
+
+ case CL_DRIVER_VERSION:
+ if (param_value_size_ret) {
+ *param_value_size_ret = device->driver_version_sz;
+ if (!param_value)
+ return CL_SUCCESS;
+ }
+ if (param_value_size < device->driver_version_sz)
+ return CL_INVALID_VALUE;
+ memcpy(param_value, device->driver_version, device->driver_version_sz);
+ return CL_SUCCESS;
+
default: return CL_INVALID_VALUE;
};
}
diff --git a/src/cl_device_id.h b/src/cl_device_id.h
index 610eaf6..d199ecb 100644
--- a/src/cl_device_id.h
+++ b/src/cl_device_id.h
@@ -83,12 +83,14 @@ struct _cl_device_id {
const char *profile;
const char *opencl_c_version;
const char *extensions;
+ const char *driver_version;
size_t name_sz;
size_t vendor_sz;
size_t version_sz;
size_t profile_sz;
size_t opencl_c_version_sz;
size_t extensions_sz;
+ size_t driver_version_sz;
/* Kernel specific info that we're assigning statically */
size_t wg_sz;
size_t compile_wg_sz[3];
diff --git a/src/cl_gt_device.h b/src/cl_gt_device.h
index 993017b..f26cd8a 100644
--- a/src/cl_gt_device.h
+++ b/src/cl_gt_device.h
@@ -72,6 +72,7 @@ DECL_INFO_STRING(version, OCL_VERSION_STRING)
DECL_INFO_STRING(profile, "FULL_PROFILE")
DECL_INFO_STRING(opencl_c_version, "OpenCL 1.10")
DECL_INFO_STRING(extensions, "")
+DECL_INFO_STRING(driver_version, LIBCL_VERSION_STRING)
#undef DECL_INFO_STRING
diff --git a/src/cl_platform_id.h b/src/cl_platform_id.h
index edd3aae..3a74028 100644
--- a/src/cl_platform_id.h
+++ b/src/cl_platform_id.h
@@ -25,6 +25,8 @@
#include "cl_khr_icd.h"
#include "CL/cl.h"
+#include "src/OCLConfig.h"
+
struct _cl_platform_id {
DEFINE_ICD(dispatch)
const char *profile;
@@ -61,9 +63,10 @@ extern cl_int cl_get_platform_info(cl_platform_id platform,
#define OCL_VERSION_MINOR 0
#define _STR(x) #x
-#define _JOINT(x, y) "OpenCL " _STR(x) "." _STR(y)
+#define _JOINT(x, y) _STR(x) "." _STR(y)
-#define OCL_VERSION_STRING _JOINT(OCL_VERSION_MAJOR, OCL_VERSION_MINOR)
+#define OCL_VERSION_STRING "OpenCL " _JOINT(OCL_VERSION_MAJOR, OCL_VERSION_MINOR)
+#define LIBCL_VERSION_STRING _JOINT(LIBCL_VERSION_MAJOR, LIBCL_VERSION_MINOR)
#endif /* __CL_PLATFORM_ID_H__ */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git
More information about the Pkg-opencl-devel
mailing list