Platforms to show: All Mac Windows Linux Cross-Platform
Back to OpenCLMBS module.
OpenCLMBS.AllDeviceCount(types as Int64) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
types: A bitfield that identifies the type of OpenCL device. The device_type can be used to query specific OpenCL devices or all OpenCL devices available. The valid values for device_type are specified in the following table.
cl_device_type | Description |
kDeviceTypeCPU | An OpenCL device that is the host processor. The host processor runs the OpenCL implementations and is a single or multi-core CPU. |
kDeviceTypeGPU | An OpenCL device that is a GPU. By this we mean that the device can also be used to accelerate a 3D API such as OpenGL or DirectX. |
kDeviceTypeAccelerator | Dedicated OpenCL accelerators (for example the IBM CELL Blade). These devices communicate with the host processor using a peripheral interconnect such as PCIe. |
kDeviceTypeDefault | The default OpenCL device in the system. |
kDeviceTypeAll | All OpenCL devices available in the system. |
Lasterror is set.
OpenCLMBS.AllDevices(types as Int64) as CLDeviceMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
types: A bitfield that identifies the type of OpenCL device. The device_type can be used to query specific OpenCL devices or all OpenCL devices available. The valid values for device_type are specified in the following table.
cl_device_type | Description |
kDeviceTypeCPU | An OpenCL device that is the host processor. The host processor runs the OpenCL implementations and is a single or multi-core CPU. |
kDeviceTypeGPU | An OpenCL device that is a GPU. By this we mean that the device can also be used to accelerate a 3D API such as OpenGL or DirectX. |
kDeviceTypeAccelerator | Dedicated OpenCL accelerators (for example the IBM CELL Blade). These devices communicate with the host processor using a peripheral interconnect such as PCIe. |
kDeviceTypeDefault | The default OpenCL device in the system. |
kDeviceTypeAll | All OpenCL devices available in the system. |
Lasterror is set.
OpenCLMBS.GetExtensionFunctionAddress(name as string) as ptr
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The function GetExtensionFunctionAddress returns the address of the extension function named by funcname. The pointer returned should be cast to a function pointer type matching the extension function's definition defined in the appropriate extension specification and header file. A return value of nil indicates that the specified function does not exist for the implementation. A non-nil return value for GetExtensionFunctionAddress does not guarantee that an extension function is actually supported. The application must also make a corresponding query using CLPlatformMBS.Extensions or CLDeviceMBS.Extensions to determine if an extension is supported by the OpenCL implementation.
GetExtensionFunctionAddress may not be queried for core (non-extension) functions in OpenCL. For functions that are queryable with clGetExtensionFunctionAddress, implementations may choose to also export those functions statically from the object libraries implementing those functions. However, portable applications cannot rely on this behavior.
Since there is no way to qualify the query with a device, the function pointer returned must work for all implementations of that extension on different devices. The behavior of calling a device extension function on a device not supporting that extension is undefined.
OpenCLMBS.GetPictureImageFormat(pic as picture, byref RowPitch as Integer) as CLImageFormatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
As Xojo uses 4 bytes per pixel on Mac and Windows, the plugin returns ARGB (or other byte order). The alpha channel is not used as Xojo stores
Some examples using this method:
OpenCLMBS.isAvailable as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Should return true on Mac OS X 10.6 and false everywhere else.
OpenCLMBS.PlatformCount as Int64
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Typically you have two with modern Macs as you get both CPU and GPU listed.
Lasterror is set.
OpenCLMBS.Platforms as CLPlatformMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Lasterror is set.
Some examples using this method:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This is a hint from the application and does not guarantee that the compiler will not be used in the future or that the compiler will actually be unloaded by the implementation. Calls to BuildProgram after UnloadCompiler will reload the compiler, if necessary, to build the appropriate program executable.
Lasterror is set.
OpenCLMBS.WaitForEvents(events() as CLEventMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | OpenCL | MBS MacFrameworks Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
events: The events specified in event_list act as synchronization points.
Waits on the host thread for commands identified by event objects in event_list to complete. A command is considered complete if its execution status is kCommandExecutionStatusComplete or a negative value.
Lasterror is set.
The items on this page are in the following plugins: MBS MacFrameworks Plugin.