Get Device Type result is incorrect At tests/main.d, I tried printing the device information, ```d auto devices = platform.getDevices(theAllocator); writeln("Devices:"); foreach (i, ref d; devices) { writefln("\t[%d] %s", i, d.name); writefln("\t\t%s", d.vendor); writefln("\t\t(%d)%s", d.type, d.type); writefln("\t\t(%d)%s", d.queueProperties, d.queueProperties); writefln("\t\t(%d)%s", d.floatFPConfig, d.floatFPConfig); writefln("\t\t(%d)%s", d.GLobalMemoryCacheType, d.GLobalMemoryCacheType); writefln("\t\t(%d)%s", d.executionCapabilities, d.executionCapabilities); } ``` Outputs ``` Devices: [0] AMD Ryzen 7 8700G w/ Radeon 780M Graphics Intel(R) Corporation (1)default_ (1)outOfOrderExecution (1)denorm (2)readWrite (0)kernel ``` The device type was expected to be a CPU (0x2). The cause was a difference in the size of the enum type. WIP: modify device.d/queue.d
Activity
takinutani commentedon Dec 15, 2025
Output expansion code by -mixin,
from OpenCL API
and,
from CL/cl.h
The size of
Device.Typeshould be the same as that ofcl_device_type.from source/dcompute/driver/ocl/device.d
But enum base type is int, It was a size mismatch.
takinutani commentedon Dec 15, 2025
So correct device.d/queue.d enum base type, output become
by