Add opencl test (#2641)

* Add opencl test

* Add links
pull/2644/head
A2va 1 year ago committed by GitHub
parent ab7ee40c4c
commit f85fd01441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      packages/o/opencl/xmake.lua

@ -89,7 +89,23 @@ package("opencl")
end)
on_install("linux", "macosx", "android", function (package)
package:add("links", "OpenCL")
package:add("links", "OpenCLUtils")
package:add("links", "OpenCLUtilsCpp")
package:add("links", "OpenCLExt")
local configs = {"-DOPENCL_SDK_BUILD_SAMPLES=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_csnippets({test = [[
#include <stddef.h>
#include <CL/cl.h>
void test () {
cl_uint num_platforms;
clGetPlatformIDs(0, NULL, &num_platforms);
}
]]}, {configs = {languages = "c11"}}))
end)
Loading…
Cancel
Save