Replies: 1 comment
-
Thinking about this, I am starting to grow on the idea of having data being passed via an interface, and the interface being implemented by some common types. Another point that brought me to this were the native vector types, which have an additional alignment demand. I do not know whether these alignment properties are taken into account when a Go type is created from such a native type (as in On that note, it may also be necessary to look into |
Beta Was this translation helpful? Give feedback.
-
The API has a "data clump" of size and raw-pointer parameters in several of the API functions. (this topic originated from #18)
Consider two examples:
Apart from the (somewhat deliberate) mismatch of size types, is this a potential candidate for a combined type that the API understands?
If this were an interface for example, it could look like this:
and then have factory methods like
so that it reads as
Is this acceptable? Too "clever"? Not too far away from the OpenCL API?`
Speaking of "too clever" - with the interface approach, user can provide their own, there could be a
Raw(size int, ptr unsafe.Pointer) HostData
- AND the built-in types likeMemObject
could implement this on their own.Points to consider:
Beta Was this translation helpful? Give feedback.
All reactions