aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuan Zhao2019-09-06 15:50:37 -0500
committerYuan Zhao2019-09-06 16:16:46 -0500
commit3163cec48d29d4041a99844b8b8b6889e3e226a6 (patch)
treebb694b94e629e14eeaca2cc360948a0805cb86ba
parent8510b667e5fe88cb1a7594fd537d50af0ac59cdb (diff)
downloadti-opencl-3163cec48d29d4041a99844b8b8b6889e3e226a6.tar.gz
ti-opencl-3163cec48d29d4041a99844b8b8b6889e3e226a6.tar.xz
ti-opencl-3163cec48d29d4041a99844b8b8b6889e3e226a6.zip
Update platform examples to query all devices
- including the CUSTOM devices - Update TIDL library build to yocto build - MCT-1220
-rw-r--r--examples/platforms/main.cpp19
-rw-r--r--host/Makefile.inc2
2 files changed, 15 insertions, 6 deletions
diff --git a/examples/platforms/main.cpp b/examples/platforms/main.cpp
index 93760fe..bd9bd93 100644
--- a/examples/platforms/main.cpp
+++ b/examples/platforms/main.cpp
@@ -57,7 +57,7 @@ const char *devtype(cl_device_type x)
57 } 57 }
58} 58}
59 59
60void getDevices(Platform& platform, cl_device_type type); 60void getDevices(Platform& platform, cl_device_type type, cl_device_type type2);
61 61
62/****************************************************************************** 62/******************************************************************************
63* main 63* main
@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
102 platforms[p].getInfo(CL_PLATFORM_PROFILE, &str); 102 platforms[p].getInfo(CL_PLATFORM_PROFILE, &str);
103 cout << " Profile: " << str << endl; 103 cout << " Profile: " << str << endl;
104 104
105 getDevices(platforms[p], CL_DEVICE_TYPE_ACCELERATOR | 105 getDevices(platforms[p], CL_DEVICE_TYPE_ACCELERATOR,
106 CL_DEVICE_TYPE_CUSTOM); 106 CL_DEVICE_TYPE_CUSTOM);
107 } 107 }
108 } 108 }
@@ -120,16 +120,25 @@ int main(int argc, char *argv[])
120} 120}
121 121
122 122
123void getDevices(Platform& platform, cl_device_type type) 123void getDevices(Platform& platform, cl_device_type type, cl_device_type type2)
124{ 124{
125 std::string str; 125 std::string str;
126 cl_context_properties properties[] = 126 cl_context_properties properties[] =
127 {CL_CONTEXT_PLATFORM, (cl_context_properties)(platform)(), 0}; 127 {CL_CONTEXT_PLATFORM, (cl_context_properties)(platform)(), 0};
128 128
129 Context context(type, properties); 129 Context context(type, properties);
130 std::vector<Device> devices = context.getInfo<CL_CONTEXT_DEVICES>();
130 131
131 132 // Add exactly type2 (not a superset) to the list
132 std::vector<Device> devices= context.getInfo<CL_CONTEXT_DEVICES>(); 133 Context context2(type2, properties);
134 std::vector<Device> devices2 = context2.getInfo<CL_CONTEXT_DEVICES>();
135 for (auto &dev : devices2)
136 {
137 cl_device_type type;
138 dev.getInfo(CL_DEVICE_TYPE, &type);
139 if (type == type2)
140 devices.emplace_back(dev);
141 }
133 142
134 for (unsigned int d = 0; d < devices.size(); d++) 143 for (unsigned int d = 0; d < devices.size(); d++)
135 { 144 {
diff --git a/host/Makefile.inc b/host/Makefile.inc
index 70d3349..464cf4f 100644
--- a/host/Makefile.inc
+++ b/host/Makefile.inc
@@ -67,7 +67,7 @@ else
67CORESDK_VERSION ?= 06.01.00.04-20190826 67CORESDK_VERSION ?= 06.01.00.04-20190826
68endif 68endif
69 69
70TIDL_VERSION ?= 06_01_00_04-20190903 70TIDL_VERSION ?= 06_01_00_05-502-2019-09-05_20-51-00
71 71
72ifeq ($(BUILD_K2H),1) 72ifeq ($(BUILD_K2H),1)
73 CORE_SDK?=$(SDOMC_SHARED)/ti-processor-sdk-linux-k2hk-evm-$(CORESDK_VERSION) 73 CORE_SDK?=$(SDOMC_SHARED)/ti-processor-sdk-linux-k2hk-evm-$(CORESDK_VERSION)