CLProgram Class Reference

Inherits from NSObject
Declared in CLProgram.h

– initWithContext:source:

Creates a program from the given source code by compiling and building all kernels found in the code for all devices in the given context.

- (instancetype)initWithContext:(CLContext *)context source:(NSString *)source

Parameters

context

A context containing all the devices you want to run this program on.

source

The program source in OpenCL C.

Return Value

A properly initialized CLProgram instance.

Discussion

Creates a program from the given source code by compiling and building all kernels found in the code for all devices in the given context.

Declared In

CLProgram.h

– initWithContext:URL:

Convenince method to load source code from a given URL. This method calls through to initWithContext:source:

- (instancetype)initWithContext:(CLContext *)context URL:(NSURL *)URL

Discussion

Convenince method to load source code from a given URL. This method calls through to initWithContext:source:

Declared In

CLProgram.h

– buildLogForDevice:

Returns the compiler and linker output for this program on the given device. The device must be associated with this program’s context.

- (NSString *)buildLogForDevice:(CLDevice *)device

Parameters

device

The device for which to fetch the build log.

Return Value

The build log as returned by the OpenCL implementation.

Discussion

Returns the compiler and linker output for this program on the given device. The device must be associated with this program’s context.

Declared In

CLProgram.h

– kernelNamed:

Returns a single kernel with the given name from this program or nil if no kernel matching the name could be found.

- (CLKernel *)kernelNamed:(NSString *)name

Parameters

name

The kernel’s name as found in the source code with all whitespace removed.

Return Value

The kernel.

Discussion

Returns a single kernel with the given name from this program or nil if no kernel matching the name could be found.

Declared In

CLProgram.h