File tree 4 files changed +12
-37
lines changed
4 files changed +12
-37
lines changed Original file line number Diff line number Diff line change 91
91
const io_lock = ReentrantLock ()
92
92
function log_error (message... )
93
93
@async begin
94
- lock (STDERR )
94
+ lock (stderr )
95
95
lock (io_lock)
96
- print (STDERR , string (message... , " \n " ))
96
+ print (stderr , string (message... , " \n " ))
97
97
unlock (io_lock)
98
- unlock (STDERR )
98
+ unlock (stderr )
99
99
end
100
100
end
101
101
Original file line number Diff line number Diff line change @@ -406,11 +406,13 @@ function info(k::Kernel, kinfo::Symbol)
406
406
return Program (ret[], retain= true )
407
407
end
408
408
409
+ # Only supported for version 1.2 and above
409
410
attributes (k:: Kernel ) = begin
410
411
size = Ref {Csize_t} ()
411
- api. clGetKernelInfo (k. id, CL_KERNEL_ATTRIBUTES,
412
- 0 , C_NULL , size)
413
- if size[] <= 1
412
+ rcode = api. clGetKernelInfo (k. id, CL_KERNEL_ATTRIBUTES,
413
+ 0 , C_NULL , size)
414
+ # Version 1.1 mostly MESA drivers will pass through the below condition
415
+ if rcode == CL_INVALID_VALUE || size[] <= 1
414
416
return " "
415
417
end
416
418
result = Vector {CL_char} (undef, size[])
Original file line number Diff line number Diff line change @@ -60,33 +60,6 @@ function info(p::Platform, pinfo::CL_platform_info)
60
60
return CLString (result)
61
61
end
62
62
63
-
64
- let info_map = Dict {Symbol, CL_platform_info} (
65
- :profile => CL_PLATFORM_PROFILE,
66
- :version => CL_PLATFORM_VERSION,
67
- :name => CL_PLATFORM_NAME,
68
- :vendor => CL_PLATFORM_VENDOR,
69
- :extensions => CL_PLATFORM_EXTENSIONS
70
- )
71
- global info
72
- function info (p:: Platform , pinfo:: Symbol )
73
- try
74
- cl_info = info_map[pinfo]
75
- if pinfo == :extensions
76
- split (info (p, cl_info))
77
- else
78
- info (p, cl_info)
79
- end
80
- catch err
81
- if isa (err, KeyError)
82
- throw (ArgumentError (" OpenCL.Platform has no info for: $pinfo " ))
83
- else
84
- throw (err)
85
- end
86
- end
87
- end
88
- end
89
-
90
63
function devices (p:: Platform , dtype:: CL_device_type )
91
64
try
92
65
ndevices = Ref {CL_uint} ()
Original file line number Diff line number Diff line change @@ -95,11 +95,11 @@ function build!(p::Program; options = "", raise = true)
95
95
end
96
96
for (dev, status) in cl. info (p, :build_status )
97
97
if status == cl. CL_BUILD_ERROR
98
- println (STDERR , " Couldn't compile kernel: " )
98
+ println (stderr , " Couldn't compile kernel: " )
99
99
source = info (p, :source )
100
- print_with_linenumbers (source, " " , STDERR )
101
- println (STDERR , " With following build error:" )
102
- println (STDERR , cl. info (p, :build_log )[dev])
100
+ print_with_linenumbers (source, " " , stderr )
101
+ println (stderr , " With following build error:" )
102
+ println (stderr , cl. info (p, :build_log )[dev])
103
103
raise && @check err # throw the build error when raise!
104
104
end
105
105
end
You can’t perform that action at this time.
0 commit comments