This patch adds new arg-type parameters to DeviceQueue::enqueue and its overrides. This is in preparation for the Metal backend which needs this information for correct argument encoding.
Ref T92212
Differential D13357
Cycles: Metal readiness: Specify DeviceQueue::enqueue arg types Authored by Michael Jones (michael_jones) on Nov 24 2021, 9:09 PM. Tags None Subscribers None Tokens
Details This patch adds new arg-type parameters to DeviceQueue::enqueue and its overrides. This is in preparation for the Metal backend which needs this information for correct argument encoding. Ref T92212
Diff Detail
Event TimelineComment Actions What's a bit fragile here is that this information is only used by the Metal backend, so it might get out of sync. What do you think about something like this? struct DeviceKernelArguments {
enum Type {
POINTER,
INT32,
...
};
const int MAX_ARGS = 16;
Type types[MAX_ARGS];
void *values[MAX_ARGS];
size_t size = 0;
void add(device_ptr *value) { add(POINTER, value); };
void add(int32_t *value) { add(INT32, value); };
...
void add(Type type, void *value) { types[size] = type; values[size] = value; size++; }
};
Comment Actions I really like this idea. How about buffering the args directly into the DeviceQueue base class, and then enqueue would just act like a flush? Comment Actions Looks fine, just minor tweak needed.
| ||||||||||||||||||||||||||||||||||