KhronosGroup / KhronosGroup/OpenCL-TTL
Add Fixed Shape and Layout tensors to the CPP version
- Dominant language
- C
- Stars
- 43
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
At present, the shape and the layout of tensors are always a runtime value, this limits the ability of the compiler to reason about how best to optimize the object code. By having the ability to make the shape and layout compile time using tensors the compiler has increased opportunities to produce optimized output.
The approach taken is to create two shape and layout types.
TTL_shape behaves exactly as today with the the sizes passed at construction for example.
TTL_shape a_shape(10, 20, 30);
TTL_shape_const has the parameters passed at compile time as template parameters.
TTL_shape_const<10, 20, 30> a_const_shape;
The same method is used for TTL_layout[_const].
Once generated, the const/var versions are interchangeable because templates are used in the shape/layout consumers.
This duck-typing method allows the methods consuming the const/var versions to themselves be compile time optimizable.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.