View Javadoc
1   package net.bmahe.genetics4j.gpu.opencl;
2   
3   import java.util.Map;
4   
5   import org.immutables.value.Value;
6   import org.jocl.cl_command_queue;
7   import org.jocl.cl_context;
8   import org.jocl.cl_kernel;
9   import org.jocl.cl_program;
10  
11  import net.bmahe.genetics4j.gpu.opencl.model.Device;
12  import net.bmahe.genetics4j.gpu.opencl.model.KernelInfo;
13  import net.bmahe.genetics4j.gpu.opencl.model.Platform;
14  
15  @Value.Immutable
16  public interface OpenCLExecutionContext {
17  
18  	@Value.Parameter
19  	Platform platform();
20  
21  	@Value.Parameter
22  	Device device();
23  
24  	@Value.Parameter
25  	cl_context clContext();
26  
27  	@Value.Parameter
28  	cl_command_queue clCommandQueue();
29  
30  	@Value.Parameter
31  	cl_program clProgram();
32  
33  	@Value.Parameter
34  	Map<String, cl_kernel> kernels();
35  
36  	@Value.Parameter
37  	Map<String, KernelInfo> kernelInfos();
38  
39  	default KernelInfo kernelInfo(final String kernelName) {
40  		return kernelInfos().get(kernelName);
41  	}
42  
43  	public static class Builder extends ImmutableOpenCLExecutionContext.Builder {
44  	}
45  
46  	public static Builder builder() {
47  		return new Builder();
48  	}
49  }