Skip to content

Commit 18bdfb1

Browse files
committed
VENDOR_INTEL -> DEVICE_VENDOR_INTEL
1 parent a32ba51 commit 18bdfb1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

clUtil/clContext.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ cl::CLProgram::CLProgram(cl::CLContext &ctx, std::string srcFile, std::string op
8888
size_t len = src.length();
8989
cl_int err;
9090

91-
if(util::toLower(_ctx.getDeviceVendor()) == "intel") {
92-
options += "-DVENDOR_INTEL";
91+
if(util::toLower(_ctx.getDeviceVendor()).find("intel") != std::string::npos) {
92+
options += "-DDEVICE_VENDOR_INTEL";
9393
}
9494

9595
_prog = clCreateProgramWithSource(ctx.getContext(), 1, &ptr, &len, &err);
@@ -117,8 +117,8 @@ cl::CLProgram::CLProgram(cl::CLContext &ctx, const char *src, std::string option
117117
size_t len = strlen(src);
118118
cl_int err;
119119

120-
if(util::toLower(_ctx.getDeviceVendor()) == "intel") {
121-
options += "-DVENDOR_INTEL";
120+
if(util::toLower(_ctx.getDeviceVendor()).find("intel") != std::string::npos) {
121+
options += "-DDEVICE_VENDOR_INTEL";
122122
}
123123

124124
_prog = clCreateProgramWithSource(ctx.getContext(), 1, &src, &len, &err);

clUtil/clutil.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#ifndef _CL_UTIL_H
22
#define _CL_UTIL_H
33

4+
#ifdef __APPLE__
5+
#define CL_SILENCE_DEPRECATION
6+
#include <OpenCL/opencl.h>
7+
#else
48
#include <CL/cl.h>
9+
#endif
10+
511
#include <string>
612
#include <vector>
713

0 commit comments

Comments
 (0)