/*
* JOCL - Java bindings for OpenCL
*
* Copyright 2013 Marco Hutter - http://www.jocl.org/
*
* Translated to Scala by Piotr Tarsa (http://github.com/tarsa)
*/
package org.jocl.samples
import org.jocl.CL._
import org.jocl._
import java.util.{Arrays => jArrays}
import scala.Array.ofDim
/**
* A small JOCL sample that uses multiple devices.
*
* Note: This is just a basic demo, showing the possibility to use multiple
* devices simultaneously. Each device receives its own copy of the memory
* objects to work on. In real applications, there may be a more complex
* management of the buffers and the synchronization between the different
* devices, which is beyond the scope of this sample.
*/
object JOCLMultiDeviceSample {
/**
* The source code of the OpenCL program to execute, containing
* some artificial workload to compute
*/
private val programSource =
"""__kernel void sampleKernel(__global const float *input,
| __global float *output,
| int size){
| int gid = get_global_id(0);
| output[gid] = 0;
| for (int i=0; i