Skip to content

[0035] linalg::Convert calculates incorrect DstN value #853

@NealLou

Description

@NealLou

Which document does this relate to?

template <ComponentEnum DstTy, ComponentEnum SrcTy, int SrcN> struct DstN {
static const int Value =
(SrcN * ComponentTypeTraits<SrcTy>::ElementsPerScalar) /
ComponentTypeTraits<DstTy>::ElementsPerScalar;
};

Describe the issue you see with the spec
linalg::Convert calculates incorrect DstN value, the current formula performs integer division with truncation, but the result needs to be rounded up.
e.g. Convert F16->Fp8, SrcN=3, result in a DstN=0.

Additional context
DXC has fix that microsoft/DirectXShaderCompiler#8359, spec needs to be updated.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions