Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.

add ability to launch string kernels #30

Merged
merged 1 commit into from
Jun 4, 2018
Merged

Conversation

SimonDanisch
Copy link
Member

No description provided.

@SimonDanisch
Copy link
Member Author

Allows to do this:

           copy_source = """
                __kernel void copy(
                    __global float *dest,
                    __global float *source
                ){
                int gid = get_global_id(0);
                dest[gid] = source[gid];
                }
            """
            source = rand(CLArray{Float32}, 1023, 11)
            dest = zeros(CLArray{Float32}, size(source))
            gpu_call(:copy => copy_source, dest, (dest, source))
            Array(dest) == Array(source)

Note, that the caching of the functor is not very nice, so for repeated calls, one might want to do
this part manually:

function _gpu_call(f, A::CLArray, args::Tuple, blocks_threads::Tuple{T, T}) where T <: NTuple{N, Integer} where N

@SimonDanisch
Copy link
Member Author

@ranocha

@SimonDanisch
Copy link
Member Author

@maleadt any idea whats up with this:

INFO: Testing CLArrays
ERROR: LoadError: CLError(code=-1001, CL_PLATFORM_NOT_FOUND_KHR)
Stacktrace:
 [1] macro expansion at /var/lib/buildbot/workers/julia/CLArrays-julia06-x86-64bit/depot/v0.6/OpenCL/src/macros.jl:6 [inlined]
 [2] platforms() at /var/lib/buildbot/workers/julia/CLArrays-julia06-x86-64bit/depot/v0.6/OpenCL/src/platform.jl:21
 [3] devices() at /var/lib/buildbot/workers/julia/CLArrays-julia06-x86-64bit/depot/v0.6/OpenCL/src/platform.jl:104
 [4] devices() at /var/lib/buildbot/workers/julia/CLArrays-julia06-x86-64bit/depot/v0.6/CLArrays/src/device.jl:6
 [5] anonymous at ./<missing>:?
 [6] include_from_node1(::String) at ./loading.jl:576
 [7] include(::String) at ./sysimg.jl:14
 [8] process_options(::Base.JLOptions) at ./client.jl:305
 [9] _start() at ./client.jl:371
while loading /var/lib/buildbot/workers/julia/CLArrays-julia06-x86-64bit/depot/v0.6/CLArrays/test/runtests.jl, in expression starting on line 4

@maleadt
Copy link
Member

maleadt commented Jun 4, 2018

@SimonDanisch fixed

@SimonDanisch
Copy link
Member Author

Thank you :)

@SimonDanisch SimonDanisch merged commit b8fc593 into master Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants