-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from JuliaGPU/vc/version_api
Minimum version macros
- Loading branch information
Showing
6 changed files
with
125 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ const tests = [ | |
"context" | ||
"device" | ||
"cmdqueue" | ||
"macros" | ||
"event" | ||
"program" | ||
"kernel" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using FactCheck | ||
using Base.Test | ||
|
||
import OpenCL | ||
const cl = OpenCL | ||
|
||
facts("OpenCL.Macros") do | ||
|
||
context("OpenCL.Macros version platform") do | ||
for platform in cl.platforms() | ||
|
||
version = cl.opencl_version(platform) | ||
|
||
v11 = cl.@min_v11? platform true : false | ||
v12 = cl.@min_v12? platform true : false | ||
v20 = cl.@min_v20? platform true : false | ||
|
||
if version == v"1.0" | ||
@fact v11 => false | ||
@fact v12 => false | ||
@fact v20 => false | ||
|
||
elseif version == v"1.1" | ||
@fact v11 => true | ||
@fact v12 => false | ||
@fact v20 => false | ||
|
||
elseif version == v"1.2" | ||
@fact v11 => true | ||
@fact v12 => true | ||
@fact v20 => false | ||
|
||
elseif version == v"2.0" | ||
@fact v11 => true | ||
@fact v12 => true | ||
@fact v20 => true | ||
|
||
end | ||
end | ||
end | ||
|
||
context("OpenCL.Macros version device") do | ||
for platform in cl.platforms() | ||
for device in cl.devices(platform) | ||
version = cl.opencl_version(device) | ||
|
||
v11 = cl.@min_v11? device true : false | ||
v12 = cl.@min_v12? device true : false | ||
v20 = cl.@min_v20? device true : false | ||
|
||
if version == v"1.0" | ||
@fact v11 => false | ||
@fact v12 => false | ||
@fact v20 => false | ||
|
||
elseif version == v"1.1" | ||
@fact v11 => true | ||
@fact v12 => false | ||
@fact v20 => false | ||
|
||
elseif version == v"1.2" | ||
@fact v11 => true | ||
@fact v12 => true | ||
@fact v20 => false | ||
|
||
elseif version == v"2.0" | ||
@fact v11 => true | ||
@fact v12 => true | ||
@fact v20 => true | ||
|
||
end | ||
end | ||
end | ||
end | ||
end | ||
|