5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/metacl/templates/upload_to_gpu.rb', line 5
def render(object, platform)
if platform == :cl
case object.klass
when :matrix
@result = "queue.enqueueWriteBuffer(buffer_#{object.name},CL_TRUE,0,sizeof(#{object.type})*#{object.size_n}*#{object.size_m},#{object.name}.data());\n"
when :array
@result = "queue.enqueueWriteBuffer(buffer_#{object.name},CL_TRUE,0,sizeof(#{object.type})*#{object.length},#{object.name}.data());\n"
when :numeric
end
end
@result || ''
end
|