Skip to content

Add a SET command for OPENCL-C #428

@dj2

Description

@dj2

Along with binding buffers to kernels we need to be able to set scalar arguments:

SHADER opencl-c my_kernel CLSPV
kernel void foo(global int4* in, global int4* out, int z) {
  out[z] = in[z];
END
BUFFER in_buf TYPE int4 DATA
7 4 2 3
END
BUFFER out_buf TYPE int4 SIZE 1

PIPELINE my_pipeline
  ATTACH my_kernel
  BIND BUFFER foo OPENCL-C KERNEL in_buf ARG in
  BIND BUFFER foo OPENCL-C KERNEL out_buf ARG out
  SET OPENCL-C DATA KERNEL foo ARG z 2
END
RUN my_pipeline

This would set the z argument to 2 when the pipeline is executed. If there are multiple arguments they may need to get combined into a single POD argument based on what the clspv computer requests.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions