Skip to content

Commit

Permalink
formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski authored and vchuravy committed Aug 27, 2014
1 parent b615753 commit 0fcc980
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,34 @@ end
const libopencl = "OpenCL"
end

macro ocl_func(func, ret_type, arg_types)
function _ocl_func(func, ret_type, arg_types)
local args_in = Symbol[symbol("arg$i::$T")
for (i, T) in enumerate(arg_types.args)]
esc(quote
$func($(args_in...)) = ccall(($(string(func)), libopencl),
$ret_type,
$arg_types,
$(args_in...))
function $func($(args_in...))
ccall(($(string(func)), libopencl),
$ret_type,
$arg_types,
$(args_in...))
end
end)
end

macro ocl_func(func, ret_type, arg_types)
_ocl_func(func, ret_type, arg_types)
end

typealias CL_callback Ptr{Void}
typealias CL_user_data Any

include("api/opencl_10.jl")
include("api/opencl_11.jl")
include("api/opencl_12.jl")
include("api/opencl_1.0.0.jl")
include("api/opencl_1.1.0.jl")
include("api/opencl_1.2.0.jl")

function parse_version(version_string)
mg = match(r"^OpenCL ([0-9]+)\.([0-9]+) .*$", version_string)
if mg == nothing
error("Non conform version string: $(ver)")
error("Non conforming version string: $(ver)")
end
return VersionNumber(int(mg.captures[1]), int(mg.captures[2]))
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0fcc980

Please sign in to comment.