summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-05-15 02:57:47 +0000
committerGitHub <noreply@github.com>2025-05-14 19:57:47 -0700
commitb4d3d3017640581c21b52a12413d3f074ab1c5c1 (patch)
tree2a3fc8350a590e7f342df328b7d9c4469ac40298
parent2275e18fc052239fe67f3fda68252ad92bb83ca9 (diff)
Support the new CoopVec builtins (#7108)
**NOTE: This is a breaking change for users who were using POC variant of DXC. In order to keep the compatibility, the users will have to use -capability hlsl_coopvec_poc to their command line. This PR adds a new capability "hlsl_coopvec_poc". When it is used, the HLSL for CoopVec will be emitted for the POC variant of DXC. When it is not used, the HLSL for CoopVec will be emitted for the DXC that officially supports the cooperative vector.
-rw-r--r--docs/command-line-slangc-reference.md1
-rw-r--r--docs/user-guide/a3-02-reference-capability-atoms.md15
-rw-r--r--source/slang/hlsl.meta.slang494
-rw-r--r--source/slang/slang-capabilities.capdef6
-rw-r--r--source/slang/slang-emit-c-like.cpp65
-rw-r--r--source/slang/slang-emit-c-like.h3
-rw-r--r--source/slang/slang-emit-hlsl.cpp4
-rw-r--r--source/slang/slang.cpp11
-rw-r--r--tests/cooperative-vector/add.slang13
-rw-r--r--tests/cooperative-vector/atan.slang2
-rw-r--r--tests/cooperative-vector/clamp.slang2
-rw-r--r--tests/cooperative-vector/comparison.slang2
-rw-r--r--tests/cooperative-vector/conversion.slang2
-rw-r--r--tests/cooperative-vector/copyFrom.slang2
-rw-r--r--tests/cooperative-vector/div.slang2
-rw-r--r--tests/cooperative-vector/exp.slang2
-rw-r--r--tests/cooperative-vector/fill.slang2
-rw-r--r--tests/cooperative-vector/fma.slang2
-rw-r--r--tests/cooperative-vector/load-store-groupshared.slang2
-rw-r--r--tests/cooperative-vector/load-store-rwbyteaddressbuffer.slang2
-rw-r--r--tests/cooperative-vector/load-store-rwstructuredbuffer.slang2
-rw-r--r--tests/cooperative-vector/log.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-mut.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-packed-mut.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-rw-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-rw.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-rwbyteaddress-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias-structuredbuffer-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-bias.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-byteaddress.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-mut.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-packed-mut.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-rw-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-rw.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-rwbyteaddress-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang2
-rw-r--r--tests/cooperative-vector/matrix-mul.slang2
-rw-r--r--tests/cooperative-vector/max.slang2
-rw-r--r--tests/cooperative-vector/min.slang2
-rw-r--r--tests/cooperative-vector/mod.slang2
-rw-r--r--tests/cooperative-vector/mul.slang2
-rw-r--r--tests/cooperative-vector/outer-product-structuredbuffer.slang2
-rw-r--r--tests/cooperative-vector/outer-product.slang2
-rw-r--r--tests/cooperative-vector/reduce-sum-accumulate-structuredbuffer.slang2
-rw-r--r--tests/cooperative-vector/reduce-sum-accumulate.slang2
-rw-r--r--tests/cooperative-vector/scalar-mul.slang2
-rw-r--r--tests/cooperative-vector/simple.slang2
-rw-r--r--tests/cooperative-vector/step.slang2
-rw-r--r--tests/cooperative-vector/sub.slang2
-rw-r--r--tests/cooperative-vector/subscript.slang2
-rw-r--r--tests/cooperative-vector/tanh.slang2
-rw-r--r--tests/cooperative-vector/unary.slang2
-rw-r--r--tests/cooperative-vector/variadic-init-cast.slang2
-rw-r--r--tests/cooperative-vector/variadic-init.slang2
56 files changed, 544 insertions, 162 deletions
diff --git a/docs/command-line-slangc-reference.md b/docs/command-line-slangc-reference.md
index 9f5295470..f296a6f02 100644
--- a/docs/command-line-slangc-reference.md
+++ b/docs/command-line-slangc-reference.md
@@ -1075,6 +1075,7 @@ A capability describes an optional feature that a target may or may not support.
* `metallib_3_1`
* `hlsl_nvapi`
* `hlsl_2018`
+* `hlsl_coopvec_poc`
* `vertex`
* `fragment`
* `compute`
diff --git a/docs/user-guide/a3-02-reference-capability-atoms.md b/docs/user-guide/a3-02-reference-capability-atoms.md
index 12cda6bed..116701119 100644
--- a/docs/user-guide/a3-02-reference-capability-atoms.md
+++ b/docs/user-guide/a3-02-reference-capability-atoms.md
@@ -7,12 +7,12 @@ Capability Atoms
### Sections:
-1. [Targets](#Targets)
-2. [Stages](#Stages)
-3. [Versions](#Versions)
-4. [Extensions](#Extensions)
-5. [Compound Capabilities](#Compound-Capabilities)
-6. [Other](#Other)
+1. [Targets](#targets)
+2. [Stages](#stages)
+3. [Versions](#versions)
+4. [Extensions](#extensions)
+5. [Compound Capabilities](#compound-capabilities)
+6. [Other](#other)
Targets
----------------------
@@ -155,6 +155,9 @@ Versions
`hlsl_2018`
> Represet HLSL compatibility support.
+`hlsl_coopvec_poc`
+> Represet compatibility support for the deprecated POC DXC
+
`dxil_lib`
> Represents capabilities required for DXIL Library compilation.
diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang
index 34423d4f3..2382d4a9a 100644
--- a/source/slang/hlsl.meta.slang
+++ b/source/slang/hlsl.meta.slang
@@ -23068,6 +23068,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[ForceInline]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
__init()
{
this = CoopVec<T, N>(T(0));
@@ -23075,6 +23076,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[ForceInline]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
__init(T t)
{
this.fill(t);
@@ -23082,6 +23084,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[ForceInline]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
__init<U : __BuiltinArithmeticType>(CoopVec<U, N> other)
{
this.copyFrom(other);
@@ -23097,6 +23100,8 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[OverloadRank(-10)]
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
__init(int i)
{
this = CoopVec<T, N>(T(i));
@@ -23115,14 +23120,18 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// Copy values from another CoopVec instance into this one. The source CoopVec can have a different element type,
/// in which case appropriate type conversion will be performed.
/// @param other The source CoopVec to copy from.
- [require(hlsl)]
[mutating]
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void copyFrom<U : __BuiltinArithmeticType>(CoopVec<U,N> other)
{
__target_switch
{
- case hlsl: __intrinsic_asm ".CopyFrom";
+ case hlsl:
+ __intrinsic_asm "$0 = $1";
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".CopyFrom";
default:
if (__isFloat<T>() && __isInt<U>())
this = __int_to_float_cast<T>(other);
@@ -23137,9 +23146,9 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// Fill all elements of this CoopVec with the specified value.
/// @param t The value to fill all elements with.
- [require(cooperative_vector)]
[mutating]
- [ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void fill(T t)
{
__target_switch
@@ -23151,10 +23160,15 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
result:$$CoopVec<T, N> = OpCompositeConstructReplicateEXT $t;
};
case hlsl:
- case hlsl: __intrinsic_asm ".Fill";
+ for(int i = 0; i < N; ++i)
+ this[i] = t;
+ return;
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".Fill";
default:
for(int i = 0; i < N; ++i)
this[i] = t;
+ return;
}
}
@@ -23165,8 +23179,8 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// Store all elements of this CoopVec into a buffer at a specified offset.
/// @param buffer The destination buffer to store the values into.
/// @param byteOffset16ByteAligned The byte offset from the start of the buffer where the data will be stored. Must be 16-byte aligned.
- [ForceInline]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void store(RWByteAddressBuffer buffer, int32_t byteOffset16ByteAligned = 0)
{
__target_switch
@@ -23178,17 +23192,19 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
// TODO: Should this be a byte offset
OpCooperativeVectorStoreNV $ptr $byteOffset16ByteAligned $this None;
};
-#ifdef NOT_SUPPORTED_YET
case hlsl:
- this.__Store(buffer, byteOffset16ByteAligned);
-#endif
+ __intrinsic_asm "$1.Store< vector<$[0], $[1]> >($2, $0)", T, N;
+ case hlsl_coopvec_poc:
+ for(int i = 0; i < N; ++i)
+ buffer.StoreByteOffset(byteOffset16ByteAligned + __elemToByteOffset<T>(i), this[i]);
+ return;
default:
for(int i = 0; i < N; ++i)
buffer.StoreByteOffset(byteOffset16ByteAligned + __elemToByteOffset<T>(i), this[i]);
+ return;
}
}
- [ForceInline]
[require(cooperative_vector)]
void store(RWStructuredBuffer<T> buffer, int32_t byteOffset16ByteAligned = 0)
{
@@ -23201,10 +23217,6 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
// TODO: Should this be a byte offset
OpCooperativeVectorStoreNV $ptr $byteOffset16ByteAligned $this None;
};
-#ifdef NOT_SUPPORTED_YET
- case hlsl:
- this.__Store(buffer, byteOffset16ByteAligned);
-#endif
default:
for(int i = 0; i < N; ++i)
buffer[i + __byteToElemOffset<T>(byteOffset16ByteAligned)] = this[i];
@@ -23213,19 +23225,23 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[ForceInline]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void store<let M : int>(__ref groupshared T[M] data, int32_t byteOffset16ByteAligned = 0)
{
+ static_assert(N <= M, "The destination vector size is smaller than the input.");
__target_switch
{
case spirv:
spirv_asm{
OpCooperativeVectorStoreNV &data $byteOffset16ByteAligned $this None;
};
- case hlsl:
+ case hlsl_coopvec_poc:
this.__Store(data, __byteToElemOffset<T>(byteOffset16ByteAligned));
+ return;
default:
for(int i = 0; i < N; ++i)
data[i + __byteToElemOffset<T>(byteOffset16ByteAligned)] = this[i];
+ return;
}
}
@@ -23236,6 +23252,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[require(spirv, cooperative_vector)]
void storeAny<U, let M : int>(__ref groupshared U[M] data, int32_t byteOffset16ByteAligned = 0)
{
+ static_assert(N <= M, "The destination vector size is smaller than the input.");
__target_switch
{
case spirv:
@@ -23262,9 +23279,9 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// @param buffer The source buffer to load data from.
/// @param byteOffset16ByteAligned The byte offset from the start of the buffer. Must be 16-byte aligned.
/// @return A new cooperative vector containing the loaded values.
- [ForceInline]
[__NoSideEffect]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
static CoopVec<T, N> load(ByteAddressBuffer buffer, int32_t byteOffset16ByteAligned = 0)
{
__target_switch
@@ -23276,6 +23293,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
result:$$CoopVec<T, N> = OpCooperativeVectorLoadNV $ptr $byteOffset16ByteAligned None;
};
case hlsl:
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret;
ret.__Load(buffer, byteOffset16ByteAligned);
return ret;
@@ -23288,9 +23306,9 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
return CoopVec<T, N>();
}
- [ForceInline]
[__NoSideEffect]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
static CoopVec<T, N> load(RWByteAddressBuffer buffer, int32_t byteOffset16ByteAligned = 0)
{
__target_switch
@@ -23302,6 +23320,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
result:$$CoopVec<T, N> = OpCooperativeVectorLoadNV $ptr $byteOffset16ByteAligned None;
};
case hlsl:
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret;
ret.__Load(buffer, byteOffset16ByteAligned);
return ret;
@@ -23314,9 +23333,9 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
return CoopVec<T, N>();
}
- [ForceInline]
[__NoSideEffect]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
static CoopVec<T, N> load(StructuredBuffer<T> buffer, int32_t byteOffset16ByteAligned = 0)
{
__target_switch
@@ -23327,12 +23346,6 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
{
result:$$CoopVec<T, N> = OpCooperativeVectorLoadNV $ptr $byteOffset16ByteAligned None;
};
-#ifdef NOT_SUPPORTED_YET
- case hlsl:
- CoopVec<T, N> ret;
- ret.__Load(buffer, byteOffset16ByteAligned);
- return ret;
-#endif
default:
var vec = CoopVec<T, N>();
for(int i = 0; i < N; ++i)
@@ -23342,7 +23355,6 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
return CoopVec<T, N>();
}
- [ForceInline]
[__NoSideEffect]
[require(spirv, cooperative_vector)]
static CoopVec<T, N> load(RWStructuredBuffer<T> buffer, int32_t byteOffset16ByteAligned = 0)
@@ -23355,12 +23367,6 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
{
result:$$CoopVec<T, N> = OpCooperativeVectorLoadNV $ptr $byteOffset16ByteAligned None;
};
-#ifdef NOT_SUPPORTED_YET
- case hlsl:
- CoopVec<T, N> ret;
- ret.__Load(buffer, byteOffset16ByteAligned);
- return ret;
-#endif
default:
var vec = CoopVec<T, N>();
for(int i = 0; i < N; ++i)
@@ -23373,8 +23379,10 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[ForceInline]
[__NoSideEffect]
[require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
static CoopVec<T, N> load<let M : int>(__constref groupshared const T[M] data, int32_t byteOffset16ByteAligned = 0)
{
+ static_assert(N <= M, "The destination vector size is smaller than the input.");
__target_switch
{
case spirv:
@@ -23382,6 +23390,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
result:$$CoopVec<T, N> = OpCooperativeVectorLoadNV &data $byteOffset16ByteAligned None
};
case hlsl:
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret;
ret.__Load(data, __byteToElemOffset<T>(byteOffset16ByteAligned));
return ret;
@@ -23403,6 +23412,7 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[require(spirv, cooperative_vector)]
static CoopVec<T, N> loadAny<U : __BuiltinArithmeticType, let M : int>(__constref groupshared const U[M] data, int32_t byteOffset16ByteAligned = 0)
{
+ static_assert(N <= M, "The destination vector size is smaller than the input.");
__target_switch
{
case spirv:
@@ -23452,22 +23462,28 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[ForceInline]
[__NoSideEffect]
[nonmutating]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
get
{
__target_switch
{
- case hlsl: __intrinsic_asm ".ReadFromIndex";
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".ReadFromIndex";
default: return __indexRead(index);
}
}
[ForceInline]
[mutating]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
set
{
__target_switch
{
- case hlsl: __intrinsic_asm ".WriteToIndex";
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".WriteToIndex";
default: __indexRef(index) = newValue;
}
}
@@ -23483,6 +23499,8 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// Creates a new cooperative vector with all elements initialized to the specified scalar value.
/// @param t The scalar value to replicate across all elements.
/// @return A new cooperative vector where each element equals the input value.
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
static CoopVec<T, N> replicate(T t)
{
CoopVec<T, N> ret;
@@ -23561,12 +23579,17 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
This __pureAdd(This other);
[mutating]
+ [ForceInline]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutAdd(This other)
{
__target_switch
{
- case hlsl: __intrinsic_asm ".Add";
+ case hlsl:
+ __intrinsic_asm "$0 += $1";
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".Add";
}
}
@@ -23575,11 +23598,15 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// @return A new cooperative vector containing the sum of the two vectors.
// TODO: Why is this ForceInline necessary for hlsl, dxc bug?
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
This add(This other)
{
__target_switch
{
case hlsl:
+ __intrinsic_asm "$0 + $1";
+ case hlsl_coopvec_poc:
This ret = this;
ret.__mutAdd(other);
return ret;
@@ -23592,18 +23619,29 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutSub(This other)
- { __target_switch { case hlsl: __intrinsic_asm ".Subtract"; } }
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "$0 -= $1";
+ case hlsl_coopvec_poc: __intrinsic_asm ".Subtract";
+ }
+ }
/// Performs component-wise subtraction with another cooperative vector.
/// @param other The cooperative vector to subtract from this vector.
/// @return A new cooperative vector containing the difference of the two vectors.
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
This sub(This other)
{
__target_switch
{
case hlsl:
+ __intrinsic_asm "$0 - $1";
+ case hlsl_coopvec_poc:
This ret = this;
ret.__mutSub(other);
return ret;
@@ -23616,18 +23654,29 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutMul(This other)
- { __target_switch { case hlsl: __intrinsic_asm ".Multiply"; } }
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "$0 *= $1";
+ case hlsl_coopvec_poc: __intrinsic_asm ".Multiply";
+ }
+ }
/// Performs component-wise multiplication with another cooperative vector.
/// @param other The cooperative vector to multiply with this vector.
/// @return A new cooperative vector containing the product of the two vectors.
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
This mul(This other)
{
__target_switch
{
case hlsl:
+ __intrinsic_asm "$0 * $1";
+ case hlsl_coopvec_poc:
This ret = this;
ret.__mutMul(other);
return ret;
@@ -23640,18 +23689,29 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutDiv(This other)
- { __target_switch { case hlsl: __intrinsic_asm ".Divide"; } }
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "$0 /= $1";
+ case hlsl_coopvec_poc: __intrinsic_asm ".Divide";
+ }
+ }
/// Performs component-wise division with another cooperative vector.
/// @param other The cooperative vector to divide this vector by.
/// @return A new cooperative vector containing the quotient of the two vectors.
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
This div(This other)
{
__target_switch
{
case hlsl:
+ __intrinsic_asm "$0 / $1";
+ case hlsl_coopvec_poc:
This ret = this;
ret.__mutDiv(other);
return ret;
@@ -23661,18 +23721,29 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutMod(This other)
- { __target_switch { case hlsl: __intrinsic_asm ".Mod"; } }
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "$0 %= %1";
+ case hlsl_coopvec_poc: __intrinsic_asm ".Mod";
+ }
+ }
/// Performs component-wise remainder operation between two cooperative vectors.
/// @param other The cooperative vector to compute the remainder with.
/// @return A new cooperative vector containing the remainder of the division between corresponding components.
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
This mod(This other)
{
__target_switch
{
case hlsl:
+ __intrinsic_asm "$0 % $1";
+ case hlsl_coopvec_poc:
This ret = this;
ret.__mutMod(other);
return ret;
@@ -23690,11 +23761,15 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
/// Returns a new cooperative vector where each component has its sign negated.
/// @return A new cooperative vector containing the negated values.
//[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
This neg()
{
__target_switch
{
case hlsl:
+ __intrinsic_asm "-$0";
+ case hlsl_coopvec_poc:
This ret = this;
for(int i = 0; i < N; ++i)
ret[i] = -this[i];
@@ -23705,54 +23780,130 @@ struct CoopVec<T : __BuiltinArithmeticType, let N : int> : IArray<T>, IArithmeti
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutScalarMul(T t)
- { __target_switch { case hlsl: __intrinsic_asm ".ScalarMultiply"; } }
+ {
+ __target_switch
+ {
+ case hlsl: __intrinsic_asm "$0 *= $1";
+ case hlsl_coopvec_poc: __intrinsic_asm ".ScalarMultiply";
+ }
+ }
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutMin(This other)
- { __target_switch { case hlsl: __intrinsic_asm ".Min"; } }
+ {
+ __target_switch
+ {
+ case hlsl: static_assert(false, "Not supported");
+ case hlsl_coopvec_poc: __intrinsic_asm ".Min";
+ }
+ }
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutMax(This other)
- { __target_switch { case hlsl: __intrinsic_asm ".Max"; } }
+ {
+ __target_switch
+ {
+ case hlsl: static_assert(false, "Not supported");
+ case hlsl_coopvec_poc: __intrinsic_asm ".Max";
+ }
+ }
[mutating]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __mutClamp(This minVal, This maxVal)
- { __target_switch { case hlsl: __intrinsic_asm ".Clamp"; } }
+ {
+ __target_switch
+ {
+ case hlsl: static_assert(false, "Not supported");
+ case hlsl_coopvec_poc: __intrinsic_asm ".Clamp";
+ }
+ }
//
// Internal utilities for loading and storing
//
[mutating]
+ [ForceInline]
[require(hlsl, byteaddressbuffer)]
+ [require(hlsl_coopvec_poc, byteaddressbuffer)]
void __Load(const ByteAddressBuffer buffer, uint byteOffset, uint alignment = 0)
- { __target_switch { case hlsl: __intrinsic_asm ".Load"; } }
+ {
+ __target_switch
+ {
+ case hlsl:
+ __intrinsic_asm "$0 = $1.Load< vector<$[0], $[1]> >($2)", T, N;
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".Load";
+ }
+ }
[mutating]
+ [ForceInline]
[require(hlsl, byteaddressbuffer_rw)]
+ [require(hlsl_coopvec_poc, byteaddressbuffer_rw)]
void __Load(const RWByteAddressBuffer buffer, uint byteOffset, uint alignment = 0)
- { __target_switch { case hlsl: __intrinsic_asm ".Load"; } }
+ {
+ __target_switch
+ {
+ case hlsl:
+ __intrinsic_asm "$0 = $1.Load< vector<$[0], $[1]> >($2)", T, N;
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".Load";
+ }
+ }
__generic<let M : int>
[mutating]
// Careful, this takes the offset in elements
+ [ForceInline]
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
void __Load(__constref groupshared T buffer[M], uint elemOffset)
- { __target_switch { case hlsl: __intrinsic_asm ".Load"; } }
+ {
+ static_assert(N <= M, "The given groupshared array is smaller than the given CoopVec");
+ __target_switch
+ {
+ case hlsl:
+ [ForceUnroll]
+ for(int i = 0; i < N; ++i)
+ this[i] = buffer[i + elemOffset];
+ return;
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".Load";
+ }
+ }
[require(hlsl, byteaddressbuffer_rw)]
+ [require(hlsl_coopvec_poc, byteaddressbuffer_rw)]
void __Store(RWByteAddressBuffer buffer, uint byteOffset, uint alignment = 0)
- { __target_switch { case hlsl: __intrinsic_asm ".Store"; } }
+ {
+ __target_switch
+ {
+ case hlsl: static_assert(false, "Not supported");
+ case hlsl_coopvec_poc: __intrinsic_asm ".Store";
+ }
+ }
__generic<let M : int>
[require(hlsl)]
+ [require(hlsl_coopvec_poc)]
// Careful, this takes the offset in elements
void __Store(__ref groupshared T buffer[M], uint elemOffset)
- { __target_switch { case hlsl: __intrinsic_asm ".Store"; } }
+ {
+ __target_switch
+ {
+ case hlsl: static_assert(false, "Not supported");
+ case hlsl_coopvec_poc: __intrinsic_asm ".Store";
+ }
+ }
${{{{
static const struct {
@@ -23766,7 +23917,9 @@ static const struct {
for(auto buffer : kByteAddressBufferCases) {
}}}}
[mutating]
+ [ForceInline]
[require(hlsl, byteaddressbuffer_rw)]
+ [require(hlsl_coopvec_poc, byteaddressbuffer_rw)]
void __mutMatMul<U : __BuiltinArithmeticType, let K : int>(
CoopVec<U, K> input, uint inputInterpretationHLSL,
$(buffer.type) matrix, uint matrixOffset, uint matrixInterpretationHLSL,
@@ -23774,12 +23927,30 @@ for(auto buffer : kByteAddressBufferCases) {
{
__target_switch
{
- case hlsl: __intrinsic_asm ".MatMul";
+ case hlsl:
+ if (T is __BuiltinSignedArithmeticType)
+ {
+ if (U is __BuiltinSignedArithmeticType)
+ __intrinsic_asm "__builtin_MatVecMul($0, false, $1, false, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
+ else
+ __intrinsic_asm "__builtin_MatVecMul($0, false, $1, true, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
+ }
+ else
+ {
+ if (U is __BuiltinSignedArithmeticType)
+ __intrinsic_asm "__builtin_MatVecMul($0, true, $1, false, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
+ else
+ __intrinsic_asm "__builtin_MatVecMul($0, true, $1, true, $2, $3, $4, $5, $6, $7, $8, $9, $10)";
+ }
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".MatMul";
}
}
[mutating]
+ [ForceInline]
[require(hlsl, byteaddressbuffer_rw)]
+ [require(hlsl_coopvec_poc, byteaddressbuffer_rw)]
void __mutMatMulAdd<U : __BuiltinArithmeticType, let K : int>(
CoopVec<U, K> input, uint inputInterpretationHLSL,
$(buffer.type) matrix, uint matrixOffset, uint matrixInterpretationHLSL,
@@ -23788,7 +23959,23 @@ for(auto buffer : kByteAddressBufferCases) {
{
__target_switch
{
- case hlsl: __intrinsic_asm ".MatMulAdd";
+ case hlsl:
+ if (T is __BuiltinSignedArithmeticType)
+ {
+ if (U is __BuiltinSignedArithmeticType)
+ __intrinsic_asm "__builtin_MatVecMulAdd($0, false, $1, false, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
+ else
+ __intrinsic_asm "__builtin_MatVecMulAdd($0, false, $1, true, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
+ }
+ else
+ {
+ if (U is __BuiltinSignedArithmeticType)
+ __intrinsic_asm "__builtin_MatVecMulAdd($0, true, $1, false, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
+ else
+ __intrinsic_asm "__builtin_MatVecMulAdd($0, true, $1, true, $2, $3, $4, $5, $9, $10, $11, $12, $13, $6, $7, $8)";
+ }
+ case hlsl_coopvec_poc:
+ __intrinsic_asm ".MatMulAdd";
}
}
@@ -23806,7 +23993,8 @@ for(auto buffer : kByteAddressBufferCases) {
/// can be packed into each element of the input vector. The k parameter specifies the actual number of
/// values to use from the packed input.
[mutating]
- [ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void matMulAccumPacked<U : __BuiltinArithmeticType, let PackedK : int>(
CoopVec<U, PackedK> input,
constexpr CoopVecComponentType inputInterpretation,
@@ -23870,6 +24058,8 @@ for(auto buffer : kByteAddressBufferCases) {
/// @param matrixStride The stride in bytes between rows/columns of the matrix.
[mutating]
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void matMulAccum<U : __BuiltinArithmeticType, let K : int>(
CoopVec<U, K> input,
constexpr CoopVecComponentType inputInterpretation,
@@ -23897,7 +24087,8 @@ for(auto buffer : kByteAddressBufferCases) {
}
[mutating]
- [ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void matMulAddAccumPacked<U : __BuiltinArithmeticType, let PackedK : int>(
CoopVec<U, PackedK> input,
constexpr CoopVecComponentType inputInterpretation,
@@ -23976,6 +24167,8 @@ for(auto buffer : kByteAddressBufferCases) {
/// while matMulAddAccumPacked allows k to be specified independently for packed interpretations.
[mutating]
[ForceInline]
+ [require(cooperative_vector)]
+ [require(hlsl_coopvec_poc)]
void matMulAddAccum<U : __BuiltinArithmeticType, let K : int>(
CoopVec<U, K> input,
constexpr CoopVecComponentType inputInterpretation,
@@ -24008,6 +24201,24 @@ for(auto buffer : kByteAddressBufferCases) {
);
}
+ [ForceInline]
+ [require(hlsl, byteaddressbuffer_rw)]
+ void __OuterProductAccumulate<let K : int>(
+ CoopVec<T, K> b,
+ $(buffer.type) matrix,
+ int32_t matrixOffset,
+ uint matrixStride,
+ uint memoryLayout,
+ uint matrixInterpretation,
+ )
+ {
+ __target_switch
+ {
+ case hlsl:
+ __intrinsic_asm "__builtin_OuterProductAccumulate($0, $1, $2, $3, $6, $5, $4)";
+ }
+ }
+
${{{{
}
@@ -24040,6 +24251,7 @@ CoopVec<T,N> __float_to_int_cast(CoopVec<U,N> val);
__generic<T : __BuiltinArithmeticType, let N : int>
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> operator *(CoopVec<T, N> lhs, const T rhs)
{
__target_switch
@@ -24061,6 +24273,8 @@ CoopVec<T, N> operator *(CoopVec<T, N> lhs, const T rhs)
return lhs;
}
case hlsl:
+ __intrinsic_asm "$0 * $1";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = lhs;
ret.__mutScalarMul(rhs);
return ret;
@@ -24076,6 +24290,7 @@ CoopVec<T, N> operator *(CoopVec<T, N> lhs, const T rhs)
__generic<T : __BuiltinArithmeticType, let N : int>
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> operator *(const T lhs, CoopVec<T, N> rhs)
{
return rhs * lhs;
@@ -24083,6 +24298,7 @@ CoopVec<T, N> operator *(const T lhs, CoopVec<T, N> rhs)
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> min<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x, CoopVec<T, N> y)
{
__target_switch
@@ -24093,6 +24309,8 @@ CoopVec<T, N> min<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x,
result:$$CoopVec<T, N> = OpExtInst glsl450 FMin $x $y;
};
case hlsl:
+ __intrinsic_asm "min($0, $1)";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = x;
ret.__mutMin(y);
return ret;
@@ -24107,6 +24325,7 @@ CoopVec<T, N> min<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x,
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> max<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x, CoopVec<T, N> y)
{
__target_switch
@@ -24117,6 +24336,8 @@ CoopVec<T, N> max<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x,
result:$$CoopVec<T, N> = OpExtInst glsl450 FMax $x $y;
};
case hlsl:
+ __intrinsic_asm "max($0, $1)";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = x;
ret.__mutMax(y);
return ret;
@@ -24130,6 +24351,7 @@ CoopVec<T, N> max<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x,
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> clamp<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x, CoopVec<T, N> minVal, CoopVec<T, N> maxVal)
{
__target_switch
@@ -24140,6 +24362,8 @@ CoopVec<T, N> clamp<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x
result:$$CoopVec<T, N> = OpExtInst glsl450 FClamp $x $minVal $maxVal;
};
case hlsl:
+ __intrinsic_asm "clamp($0, $1, $2)";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = x;
ret.__mutClamp(minVal, maxVal);
return ret;
@@ -24153,6 +24377,7 @@ CoopVec<T, N> clamp<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> min<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVec<T, N> y)
{
__target_switch
@@ -24173,6 +24398,8 @@ CoopVec<T, N> min<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVe
};
}
case hlsl:
+ __intrinsic_asm "min($0, $1)";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = x;
ret.__mutMin(y);
return ret;
@@ -24187,6 +24414,7 @@ CoopVec<T, N> min<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVe
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> max<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVec<T, N> y)
{
__target_switch
@@ -24207,6 +24435,8 @@ CoopVec<T, N> max<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVe
};
}
case hlsl:
+ __intrinsic_asm "max($0, $1)";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = x;
ret.__mutMax(y);
return ret;
@@ -24220,6 +24450,7 @@ CoopVec<T, N> max<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVe
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> clamp<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, CoopVec<T, N> minVal, CoopVec<T, N> maxVal)
{
__target_switch
@@ -24240,6 +24471,8 @@ CoopVec<T, N> clamp<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, Coop
};
}
case hlsl:
+ __intrinsic_asm "clamp($0, $1, $2)";
+ case hlsl_coopvec_poc:
CoopVec<T, N> ret = x;
ret.__mutClamp(minVal, maxVal);
return ret;
@@ -24253,10 +24486,18 @@ CoopVec<T, N> clamp<T : __BuiltinIntegerType, let N : int>(CoopVec<T, N> x, Coop
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> step<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> edge, CoopVec<T, N> x)
{
__target_switch
{
+ case hlsl:
+ __intrinsic_asm "step($0, $1)";
+ case hlsl_coopvec_poc:
+ CoopVec<T, N> ret;
+ for(int i = 0; i < N; ++i)
+ ret[i] = step(edge[i], x[i]);
+ return ret;
case spirv:
return spirv_asm
{
@@ -24272,10 +24513,18 @@ CoopVec<T, N> step<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> ed
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> exp<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x)
{
__target_switch
{
+ case hlsl:
+ __intrinsic_asm "exp($0)";
+ case hlsl_coopvec_poc:
+ CoopVec<T, N> ret;
+ for(int i = 0; i < N; ++i)
+ ret[i] = exp(x[i]);
+ return ret;
case spirv:
return spirv_asm
{
@@ -24291,10 +24540,18 @@ CoopVec<T, N> exp<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x)
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> log<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x)
{
__target_switch
{
+ case hlsl:
+ __intrinsic_asm "log($0)";
+ case hlsl_coopvec_poc:
+ CoopVec<T, N> ret;
+ for(int i = 0; i < N; ++i)
+ ret[i] = log(x[i]);
+ return ret;
case spirv:
return spirv_asm
{
@@ -24310,10 +24567,18 @@ CoopVec<T, N> log<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x)
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> tanh<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x)
{
__target_switch
{
+ case hlsl:
+ __intrinsic_asm "tanh($0)";
+ case hlsl_coopvec_poc:
+ CoopVec<T, N> ret;
+ for(int i = 0; i < N; ++i)
+ ret[i] = tanh(x[i]);
+ return ret;
case spirv:
return spirv_asm
{
@@ -24327,14 +24592,20 @@ CoopVec<T, N> tanh<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> x)
}
}
-// TODO: Why does this fail when inlined on HLSL,
-// We generate some really weird code...
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> atan<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> yOverX)
{
__target_switch
{
+ case hlsl:
+ __intrinsic_asm "atan($0)";
+ case hlsl_coopvec_poc:
+ CoopVec<T, N> ret;
+ for(int i = 0; i < N; ++i)
+ ret[i] = atan(yOverX[i]);
+ return ret;
case spirv:
return spirv_asm
{
@@ -24350,6 +24621,7 @@ CoopVec<T, N> atan<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> yO
// [ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, N> fma<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> a, CoopVec<T, N> b, CoopVec<T, N> c)
{
// TODO: Investigate, why does this fail if it's not inlined
@@ -24357,6 +24629,13 @@ CoopVec<T, N> fma<T : __BuiltinFloatingPointType, let N : int>(CoopVec<T, N> a,
// dxc generated substantially different code
__target_switch
{
+ case hlsl:
+ __intrinsic_asm "mad($0, $1, $2)";
+ case hlsl_coopvec_poc:
+ CoopVec<T, N> ret;
+ for(int i = 0; i < N; ++i)
+ ret[i] = mad(a[i], b[i], c[i]);
+ return ret;
case spirv:
return spirv_asm
{
@@ -24612,36 +24891,77 @@ uint32_t __getSpvCoopVecComponentType(CoopVecComponentType componentType)
[ForceInline]
uint32_t __getHLSLCoopVecComponentType(CoopVecComponentType componentType)
{
- switch (componentType)
+ __target_switch
{
- case CoopVecComponentType::Float16:
- return 0;
- case CoopVecComponentType::Float32:
- return 1;
- case CoopVecComponentType::UnsignedInt8:
- return 2;
- case CoopVecComponentType::UnsignedInt16:
- return 3;
- case CoopVecComponentType::UnsignedInt32:
- return 4;
- case CoopVecComponentType::SignedInt8:
- return 5;
- case CoopVecComponentType::SignedInt16:
- return 6;
- case CoopVecComponentType::SignedInt32:
- return 7;
- case CoopVecComponentType::SignedInt8Packed:
- return 8;
- case CoopVecComponentType::UnsignedInt8Packed:
- return 9;
- case CoopVecComponentType::FloatE4M3:
- return 10;
- case CoopVecComponentType::FloatE5M2:
- return 11;
- default:
- static_assert(false, "unsupported componentType value");
+ case hlsl:
+ switch (componentType)
+ {
+ case CoopVecComponentType::SignedInt16:
+ return 2;
+ case CoopVecComponentType::UnsignedInt16:
+ return 3;
+ case CoopVecComponentType::SignedInt32:
+ return 4;
+ case CoopVecComponentType::UnsignedInt32:
+ return 5;
+ case CoopVecComponentType::SignedInt64:
+ return 6;
+ case CoopVecComponentType::UnsignedInt64:
+ return 7;
+ case CoopVecComponentType::Float16:
+ return 8;
+ case CoopVecComponentType::Float32:
+ return 9;
+ case CoopVecComponentType::Float64:
+ return 10;
+ case CoopVecComponentType::SignedInt8Packed:
+ return 17;
+ case CoopVecComponentType::UnsignedInt8Packed:
+ return 18;
+ case CoopVecComponentType::UnsignedInt8:
+ return 19;
+ case CoopVecComponentType::SignedInt8:
+ return 20;
+ case CoopVecComponentType::FloatE4M3:
+ return 21;
+ case CoopVecComponentType::FloatE5M2:
+ return 22;
+ default:
+ static_assert(false, "unsupported componentType value");
+ }
+ return 0; // ComponentType::Invalid
+ case hlsl_coopvec_poc:
+ switch (componentType)
+ {
+ case CoopVecComponentType::Float16:
+ return 0;
+ case CoopVecComponentType::Float32:
+ return 1;
+ case CoopVecComponentType::UnsignedInt8:
+ return 2;
+ case CoopVecComponentType::UnsignedInt16:
+ return 3;
+ case CoopVecComponentType::UnsignedInt32:
+ return 4;
+ case CoopVecComponentType::SignedInt8:
+ return 5;
+ case CoopVecComponentType::SignedInt16:
+ return 6;
+ case CoopVecComponentType::SignedInt32:
+ return 7;
+ case CoopVecComponentType::SignedInt8Packed:
+ return 8;
+ case CoopVecComponentType::UnsignedInt8Packed:
+ return 9;
+ case CoopVecComponentType::FloatE4M3:
+ return 10;
+ case CoopVecComponentType::FloatE5M2:
+ return 11;
+ default:
+ static_assert(false, "unsupported componentType value");
+ }
+ return 32;
}
- return 32;
}
[ForceInline]
@@ -24711,6 +25031,7 @@ for(auto buffer : kByteAddressBufferCases_) {
// need it
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
__generic<T : __BuiltinArithmeticType, let M : int, let PackedK : int, U : __BuiltinArithmeticType>
CoopVec<T, M> coopVecMatMulPacked(
CoopVec<U, PackedK> input,
@@ -24854,6 +25175,7 @@ CoopVec<T, M> coopVecMatMulPacked(
/// @return A new cooperative vector containing the result of the matrix multiplication.
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
__generic<T : __BuiltinArithmeticType, let M : int, let K : int, U : __BuiltinArithmeticType>
CoopVec<T, M> coopVecMatMul(
CoopVec<U, K> input,
@@ -24900,6 +25222,7 @@ CoopVec<T, M> coopVecMatMul(
/// values to use from the packed input.
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
CoopVec<T, M> coopVecMatMulAddPacked<T : __BuiltinArithmeticType, let M : int, let PackedK : int, U : __BuiltinArithmeticType>(
CoopVec<U, PackedK> input,
constexpr CoopVecComponentType inputInterpretation,
@@ -25037,6 +25360,7 @@ CoopVec<T, M> coopVecMatMulAddPacked<T : __BuiltinArithmeticType, let M : int, l
/// @return A new cooperative vector containing the result of the matrix multiplication plus bias.
[ForceInline]
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
__generic<T : __BuiltinArithmeticType, let M : int, let K : int, U : __BuiltinArithmeticType>
CoopVec<T, M> coopVecMatMulAdd(
CoopVec<U, K> input,
@@ -25087,6 +25411,7 @@ if(buffer.isRW)
/// @param memoryLayout Specifies the memory layout of the matrix (row-major or column-major).
/// @param matrixInterpretation Specifies how to interpret the values in the matrix.
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
void coopVecOuterProductAccumulate<T : __BuiltinArithmeticType, let M : int, let N : int>(
CoopVec<T, M> a,
CoopVec<T, N> b,
@@ -25100,6 +25425,10 @@ void coopVecOuterProductAccumulate<T : __BuiltinArithmeticType, let M : int, let
__target_switch
{
case hlsl:
+ uint matrixInterpretationHLSL = __getHLSLCoopVecComponentType(matrixInterpretation);
+ uint memoryLayoutHLSL = __getHLSLCoopVecMatrixLayout(memoryLayout);
+ return a.__OuterProductAccumulate(b, matrix, matrixOffset, matrixStride, memoryLayoutHLSL, matrixInterpretationHLSL);
+ case hlsl_coopvec_poc:
__intrinsic_asm "$0.OuterProductAccumulate($1, $2, $3, $4, $5, $6)";
case spirv:
let matrixInterpretationSpirv : int = __getSpvCoopVecComponentType(matrixInterpretation);
@@ -25172,6 +25501,7 @@ void coopVecOuterProductAccumulate<T : __BuiltinArithmeticType, let M : int, let
/// @param buffer The buffer to accumulate the sum into.
/// @param offset Byte offset into the buffer.
[require(cooperative_vector)]
+[require(hlsl_coopvec_poc)]
void coopVecReduceSumAccumulate<T : __BuiltinArithmeticType, let N : int>(
CoopVec<T, N> v,
$(buffer.type) buffer,
@@ -25181,6 +25511,8 @@ void coopVecReduceSumAccumulate<T : __BuiltinArithmeticType, let N : int>(
__target_switch
{
case hlsl:
+ __intrinsic_asm "__builtin_VectorAccumulate($0, $1, $2)";
+ case hlsl_coopvec_poc:
__intrinsic_asm "$0.ReduceSumAccumulate($1, $2)";
case spirv:
let bufferPtr = buffer.GetBufferPointer();
diff --git a/source/slang/slang-capabilities.capdef b/source/slang/slang-capabilities.capdef
index 9d1a11f07..f509835aa 100644
--- a/source/slang/slang-capabilities.capdef
+++ b/source/slang/slang-capabilities.capdef
@@ -224,6 +224,10 @@ def hlsl_nvapi : hlsl;
/// [Version]
def hlsl_2018 : _sm_5_1;
+/// Represet compatibility support for the deprecated POC DXC
+/// [Version]
+def hlsl_coopvec_poc : _sm_6_8;
+
/// Represents capabilities required for DXIL Library compilation.
/// [Version]
alias dxil_lib = _sm_6_3;
@@ -1118,7 +1122,7 @@ alias bufferreference_int64 = bufferreference + GL_EXT_shader_explicit_arithmeti
/// Note that cpp and cuda are supported via a fallback non-cooperative implementation
/// No HLSL shader model bound yet
/// [Compound]
-alias cooperative_vector = _sm_6_8 | cpp | _cuda_sm_9_0 | spvCooperativeVectorNV;
+alias cooperative_vector = _sm_6_9 | cpp | _cuda_sm_9_0 | spvCooperativeVectorNV;
/// Capabilities needed to train cooperative vectors
/// [Compound]
alias cooperative_vector_training = spvCooperativeVectorTrainingNV;
diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp
index 56668d092..141a843f2 100644
--- a/source/slang/slang-emit-c-like.cpp
+++ b/source/slang/slang-emit-c-like.cpp
@@ -109,6 +109,9 @@ CLikeSourceEmitter::CLikeSourceEmitter(const Desc& desc)
m_codeGenContext = desc.codeGenContext;
m_entryPointStage = desc.entryPointStage;
m_effectiveProfile = desc.effectiveProfile;
+
+ auto targetCaps = getTargetReq()->getTargetCaps();
+ isCoopvecPoc = targetCaps.implies(CapabilityAtom::hlsl_coopvec_poc);
}
SlangResult CLikeSourceEmitter::init()
@@ -3118,18 +3121,32 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst)
case kIROp_MakeCoopVector:
{
emitType(coopVecType, getName(inst));
- m_writer->emit(";\n");
+ m_writer->emit(isCoopvecPoc ? ";\n" : " = { ");
auto elemCount = as<IRIntLit>(coopVecType->getOperand(1));
IRIntegerValue elemCountValue = elemCount->getValue();
- for (IRIntegerValue i = 0; i < elemCountValue; ++i)
+ if (isCoopvecPoc)
{
- m_writer->emit(getName(inst));
- m_writer->emit(".WriteToIndex(");
- m_writer->emit(i);
- m_writer->emit(", ");
+ for (IRIntegerValue i = 0; i < elemCountValue; ++i)
+ {
+ m_writer->emit(getName(inst));
+ m_writer->emit(".WriteToIndex(");
+ m_writer->emit(i);
+ m_writer->emit(", ");
+ emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General));
+ m_writer->emit(");\n");
+ }
+ }
+ else
+ {
+ IRIntegerValue i = 0;
+ for (; i < elemCountValue - 1; ++i)
+ {
+ emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General));
+ m_writer->emit(", ");
+ }
emitDereferenceOperand(inst->getOperand(i), getInfo(EmitOp::General));
- m_writer->emit(");\n");
+ m_writer->emit("};\n");
}
return;
}
@@ -3138,7 +3155,7 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst)
m_writer->emit(";\n");
m_writer->emit(getName(inst));
- m_writer->emit(".CopyFrom(");
+ m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = (");
emitCallExpr((IRCall*)inst, getInfo(EmitOp::General));
m_writer->emit(");\n");
return;
@@ -3147,7 +3164,7 @@ void CLikeSourceEmitter::_emitInst(IRInst* inst)
m_writer->emit(";\n");
m_writer->emit(getName(inst));
- m_writer->emit(".CopyFrom(");
+ m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = (");
emitDereferenceOperand(inst->getOperand(0), getInfo(EmitOp::General));
m_writer->emit(");\n");
return;
@@ -3409,10 +3426,21 @@ void CLikeSourceEmitter::_emitStoreImpl(IRStore* store)
auto dstPtr = store->getPtr();
if (isPointerOfType(dstPtr->getDataType(), kIROp_CoopVectorType))
{
- emitDereferenceOperand(dstPtr, getInfo(EmitOp::General));
- m_writer->emit(".CopyFrom(");
- emitDereferenceOperand(srcVal, getInfo(EmitOp::General));
- m_writer->emit(");\n");
+ if (isCoopvecPoc)
+ {
+ emitDereferenceOperand(dstPtr, getInfo(EmitOp::General));
+ m_writer->emit(".CopyFrom(");
+ emitDereferenceOperand(srcVal, getInfo(EmitOp::General));
+ m_writer->emit(");\n");
+ }
+ else
+ {
+ auto prec = getInfo(EmitOp::Assign);
+ emitDereferenceOperand(dstPtr, leftSide(getInfo(EmitOp::General), prec));
+ m_writer->emit(" = ");
+ emitOperand(srcVal, rightSide(prec, getInfo(EmitOp::General)));
+ m_writer->emit(";\n");
+ }
}
else
{
@@ -4705,7 +4733,7 @@ void CLikeSourceEmitter::emitVar(IRVar* varDecl)
{
m_writer->emit(";\n");
m_writer->emit(getName(varDecl));
- m_writer->emit(".CopyFrom(");
+ m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = (");
emitDereferenceOperand(store->getVal()->getOperand(0), getInfo(EmitOp::General));
m_writer->emit(")");
}
@@ -4713,7 +4741,7 @@ void CLikeSourceEmitter::emitVar(IRVar* varDecl)
{
m_writer->emit(";\n");
m_writer->emit(getName(varDecl));
- m_writer->emit(".CopyFrom(");
+ m_writer->emit(isCoopvecPoc ? ".CopyFrom(" : " = (");
emitCallExpr((IRCall*)store->getVal(), getInfo(EmitOp::General));
m_writer->emit(")");
}
@@ -4726,13 +4754,14 @@ void CLikeSourceEmitter::emitVar(IRVar* varDecl)
{
m_writer->emit(";\n");
m_writer->emit(getName(varDecl));
- m_writer->emit(".WriteToIndex(");
+ m_writer->emit(isCoopvecPoc ? ".WriteToIndex(" : "[");
m_writer->emit(i);
- m_writer->emit(", ");
+ m_writer->emit(isCoopvecPoc ? ", " : "] = ");
emitDereferenceOperand(
store->getVal()->getOperand(i),
getInfo(EmitOp::General));
- m_writer->emit(")");
+ if (isCoopvecPoc)
+ m_writer->emit(")");
}
}
else
diff --git a/source/slang/slang-emit-c-like.h b/source/slang/slang-emit-c-like.h
index 28dcdcc4d..f38158c0a 100644
--- a/source/slang/slang-emit-c-like.h
+++ b/source/slang/slang-emit-c-like.h
@@ -738,6 +738,9 @@ protected:
OrderedHashSet<IRStringLit*> m_requiredPreludes;
Dictionary<const char*, IRStringLit*> m_builtinPreludes;
+
+ // Indicates if we are emiting for DXC cooperative vector POC.
+ bool isCoopvecPoc = false;
};
} // namespace Slang
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp
index 3813cf9cb..ba167676a 100644
--- a/source/slang/slang-emit-hlsl.cpp
+++ b/source/slang/slang-emit-hlsl.cpp
@@ -1153,7 +1153,7 @@ void HLSLSourceEmitter::emitVectorTypeNameImpl(IRType* elementType, IRIntegerVal
// although we should not expect to run into types that don't
// have a sugared form.
//
- m_writer->emit("vector<");
+ m_writer->emit(isCoopvecPoc ? "CoopVector<" : "vector<");
emitType(elementType);
m_writer->emit(",");
m_writer->emit(elementCount);
@@ -1446,7 +1446,7 @@ void HLSLSourceEmitter::emitSimpleTypeImpl(IRType* type)
case kIROp_CoopVectorType:
{
auto coopVecType = (IRCoopVectorType*)type;
- m_writer->emit("CoopVector<");
+ m_writer->emit(isCoopvecPoc ? "CoopVector<" : "vector<");
emitType(coopVecType->getElementType());
m_writer->emit(",");
m_writer->emit(getIntVal(coopVecType->getElementCount()));
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 67d13c34b..c7f6c920c 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -2347,7 +2347,16 @@ CapabilitySet TargetRequest::getTargetCaps()
for (auto atomVal : optionSet.getArray(CompilerOptionName::Capability))
{
- auto toAdd = CapabilitySet((CapabilityName)atomVal.intValue);
+ CapabilitySet toAdd;
+ switch (atomVal.kind)
+ {
+ case CompilerOptionValueKind::Int:
+ toAdd = CapabilitySet(CapabilityName(atomVal.intValue));
+ break;
+ case CompilerOptionValueKind::String:
+ toAdd = CapabilitySet(findCapabilityName(atomVal.stringValue.getUnownedSlice()));
+ break;
+ }
if (isGLSLTarget)
targetCap.addSpirvVersionFromOtherAsGlslSpirvVersion(toAdd);
diff --git a/tests/cooperative-vector/add.slang b/tests/cooperative-vector/add.slang
index 7dd57ed9c..60968c9a6 100644
--- a/tests/cooperative-vector/add.slang
+++ b/tests/cooperative-vector/add.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -use-dxil -output-using-type -profile cs_6_8 -dx12-experimental -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
@@ -7,21 +7,22 @@
// CHECK-NEXT: 3
// CHECK-NEXT: 5
// CHECK-NEXT: 7
+// CHECK-NEXT: 9
-//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
+//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<int32_t> outputBuffer;
-//TEST_INPUT:ubuffer(data=[1 2 3 4], stride=4),name=input1
+//TEST_INPUT:ubuffer(data=[1 2 3 4 5], stride=4),name=input1
ByteAddressBuffer input1;
-//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4),name=input2
+//TEST_INPUT:ubuffer(data=[0 1 2 3 4], stride=4),name=input2
ByteAddressBuffer input2;
[numthreads(1, 1, 1)]
void computeMain()
{
- CoopVec<int, 4> vec1 = coopVecLoad<4, int32_t>(input1);
- CoopVec<int, 4> vec2 = coopVecLoad<4, int32_t>(input2);
+ CoopVec<int, 5> vec1 = coopVecLoad<5, int32_t>(input1);
+ CoopVec<int, 5> vec2 = coopVecLoad<5, int32_t>(input2);
let result = vec1 + vec2;
diff --git a/tests/cooperative-vector/atan.slang b/tests/cooperative-vector/atan.slang
index a7a292d6a..4ae135dcd 100644
--- a/tests/cooperative-vector/atan.slang
+++ b/tests/cooperative-vector/atan.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/clamp.slang b/tests/cooperative-vector/clamp.slang
index 37f3a69a8..1250aaae0 100644
--- a/tests/cooperative-vector/clamp.slang
+++ b/tests/cooperative-vector/clamp.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/comparison.slang b/tests/cooperative-vector/comparison.slang
index 99a08ae49..2b5ef30de 100644
--- a/tests/cooperative-vector/comparison.slang
+++ b/tests/cooperative-vector/comparison.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: uint32_t
diff --git a/tests/cooperative-vector/conversion.slang b/tests/cooperative-vector/conversion.slang
index 7f6a242d7..5bba7961b 100644
--- a/tests/cooperative-vector/conversion.slang
+++ b/tests/cooperative-vector/conversion.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/copyFrom.slang b/tests/cooperative-vector/copyFrom.slang
index bd85800ce..dcdc5cad0 100644
--- a/tests/cooperative-vector/copyFrom.slang
+++ b/tests/cooperative-vector/copyFrom.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/div.slang b/tests/cooperative-vector/div.slang
index 49cb9a036..a3aee5afe 100644
--- a/tests/cooperative-vector/div.slang
+++ b/tests/cooperative-vector/div.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/exp.slang b/tests/cooperative-vector/exp.slang
index 9126abea3..82c43c900 100644
--- a/tests/cooperative-vector/exp.slang
+++ b/tests/cooperative-vector/exp.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/fill.slang b/tests/cooperative-vector/fill.slang
index ac5068866..6074c1d47 100644
--- a/tests/cooperative-vector/fill.slang
+++ b/tests/cooperative-vector/fill.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/fma.slang b/tests/cooperative-vector/fma.slang
index 8872044d8..9f0e194aa 100644
--- a/tests/cooperative-vector/fma.slang
+++ b/tests/cooperative-vector/fma.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/load-store-groupshared.slang b/tests/cooperative-vector/load-store-groupshared.slang
index 281a7b6a9..20b064ac4 100644
--- a/tests/cooperative-vector/load-store-groupshared.slang
+++ b/tests/cooperative-vector/load-store-groupshared.slang
@@ -1,5 +1,5 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: 1
diff --git a/tests/cooperative-vector/load-store-rwbyteaddressbuffer.slang b/tests/cooperative-vector/load-store-rwbyteaddressbuffer.slang
index 7b88c0ee3..0bd698b7f 100644
--- a/tests/cooperative-vector/load-store-rwbyteaddressbuffer.slang
+++ b/tests/cooperative-vector/load-store-rwbyteaddressbuffer.slang
@@ -1,5 +1,5 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu
// CHECK: 1
diff --git a/tests/cooperative-vector/load-store-rwstructuredbuffer.slang b/tests/cooperative-vector/load-store-rwstructuredbuffer.slang
index 7e050db80..5f602d1a0 100644
--- a/tests/cooperative-vector/load-store-rwstructuredbuffer.slang
+++ b/tests/cooperative-vector/load-store-rwstructuredbuffer.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// HLSL doesn't support structured buffers for CoopVec
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 5
diff --git a/tests/cooperative-vector/log.slang b/tests/cooperative-vector/log.slang
index b051f2f87..3e5cd32cf 100644
--- a/tests/cooperative-vector/log.slang
+++ b/tests/cooperative-vector/log.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/matrix-mul-bias-mut.slang b/tests/cooperative-vector/matrix-mul-bias-mut.slang
index 1b1061abd..2c547987b 100644
--- a/tests/cooperative-vector/matrix-mul-bias-mut.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-mut.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 8035
diff --git a/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang b/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang
index 2f3dbfeca..29038c83d 100644
--- a/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-packed-mut.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/matrix-mul-bias-packed.slang b/tests/cooperative-vector/matrix-mul-bias-packed.slang
index 24d844fa1..16975cd09 100644
--- a/tests/cooperative-vector/matrix-mul-bias-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-packed.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/matrix-mul-bias-rw-packed.slang b/tests/cooperative-vector/matrix-mul-bias-rw-packed.slang
index 773caaf4f..15f2dd24f 100644
--- a/tests/cooperative-vector/matrix-mul-bias-rw-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-rw-packed.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL can't multiply from *RW*ByteAddressBuffers
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 35
diff --git a/tests/cooperative-vector/matrix-mul-bias-rw.slang b/tests/cooperative-vector/matrix-mul-bias-rw.slang
index 8505c2fd8..3f220fbdf 100644
--- a/tests/cooperative-vector/matrix-mul-bias-rw.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-rw.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 35
diff --git a/tests/cooperative-vector/matrix-mul-bias-rwbyteaddress-packed.slang b/tests/cooperative-vector/matrix-mul-bias-rwbyteaddress-packed.slang
index 86814666c..ea5b3ccdc 100644
--- a/tests/cooperative-vector/matrix-mul-bias-rwbyteaddress-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-rwbyteaddress-packed.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL can't multiply from *RW*ByteAddressBuffers
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 35
diff --git a/tests/cooperative-vector/matrix-mul-bias-structuredbuffer-packed.slang b/tests/cooperative-vector/matrix-mul-bias-structuredbuffer-packed.slang
index d8879c087..e9642fcb5 100644
--- a/tests/cooperative-vector/matrix-mul-bias-structuredbuffer-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-bias-structuredbuffer-packed.slang
@@ -2,7 +2,7 @@
// These platforms don't support these operations from structured buffers
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 35
diff --git a/tests/cooperative-vector/matrix-mul-bias.slang b/tests/cooperative-vector/matrix-mul-bias.slang
index 2cafa83db..3b1d70f59 100644
--- a/tests/cooperative-vector/matrix-mul-bias.slang
+++ b/tests/cooperative-vector/matrix-mul-bias.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 35
diff --git a/tests/cooperative-vector/matrix-mul-byteaddress.slang b/tests/cooperative-vector/matrix-mul-byteaddress.slang
index 6278cd7bf..7a5d50348 100644
--- a/tests/cooperative-vector/matrix-mul-byteaddress.slang
+++ b/tests/cooperative-vector/matrix-mul-byteaddress.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/matrix-mul-mut.slang b/tests/cooperative-vector/matrix-mul-mut.slang
index 98504f022..822b57e2a 100644
--- a/tests/cooperative-vector/matrix-mul-mut.slang
+++ b/tests/cooperative-vector/matrix-mul-mut.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 31
diff --git a/tests/cooperative-vector/matrix-mul-packed-mut.slang b/tests/cooperative-vector/matrix-mul-packed-mut.slang
index 7db353936..e8e480f74 100644
--- a/tests/cooperative-vector/matrix-mul-packed-mut.slang
+++ b/tests/cooperative-vector/matrix-mul-packed-mut.slang
@@ -1,6 +1,6 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
-//Test(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//Test(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 31
diff --git a/tests/cooperative-vector/matrix-mul-packed.slang b/tests/cooperative-vector/matrix-mul-packed.slang
index 9fa870f76..1c3e373a7 100644
--- a/tests/cooperative-vector/matrix-mul-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-packed.slang
@@ -1,6 +1,6 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
-//Test(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//Test(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/matrix-mul-rw-packed.slang b/tests/cooperative-vector/matrix-mul-rw-packed.slang
index 39b8339ef..45b3a8b05 100644
--- a/tests/cooperative-vector/matrix-mul-rw-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-rw-packed.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL can't multiply from *RW*ByteAddressBuffers
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/matrix-mul-rw.slang b/tests/cooperative-vector/matrix-mul-rw.slang
index d05f8a058..fea431f43 100644
--- a/tests/cooperative-vector/matrix-mul-rw.slang
+++ b/tests/cooperative-vector/matrix-mul-rw.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/matrix-mul-rwbyteaddress-packed.slang b/tests/cooperative-vector/matrix-mul-rwbyteaddress-packed.slang
index 39b8339ef..45b3a8b05 100644
--- a/tests/cooperative-vector/matrix-mul-rwbyteaddress-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-rwbyteaddress-packed.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL can't multiply from *RW*ByteAddressBuffers
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang b/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang
index 0b41099d2..b91ec3a56 100644
--- a/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang
+++ b/tests/cooperative-vector/matrix-mul-structuredbuffer-packed.slang
@@ -2,7 +2,7 @@
// These platforms don't support these operations from structured buffers
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/matrix-mul.slang b/tests/cooperative-vector/matrix-mul.slang
index 6ef83f2f8..876f7ea50 100644
--- a/tests/cooperative-vector/matrix-mul.slang
+++ b/tests/cooperative-vector/matrix-mul.slang
@@ -2,7 +2,7 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Disabled because HLSL doesn't support int8
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: int32_t
// CHECK-NEXT: 30
diff --git a/tests/cooperative-vector/max.slang b/tests/cooperative-vector/max.slang
index 285897a45..09eff40d7 100644
--- a/tests/cooperative-vector/max.slang
+++ b/tests/cooperative-vector/max.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/min.slang b/tests/cooperative-vector/min.slang
index 28e8a32a4..25c363133 100644
--- a/tests/cooperative-vector/min.slang
+++ b/tests/cooperative-vector/min.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/mod.slang b/tests/cooperative-vector/mod.slang
index f35e3f5ff..5967dc231 100644
--- a/tests/cooperative-vector/mod.slang
+++ b/tests/cooperative-vector/mod.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -emit-spirv-directly
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu
// CHECK: 0
diff --git a/tests/cooperative-vector/mul.slang b/tests/cooperative-vector/mul.slang
index 9e6b305ca..84765cdc5 100644
--- a/tests/cooperative-vector/mul.slang
+++ b/tests/cooperative-vector/mul.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/outer-product-structuredbuffer.slang b/tests/cooperative-vector/outer-product-structuredbuffer.slang
index 954fbf772..a2bbde40a 100644
--- a/tests/cooperative-vector/outer-product-structuredbuffer.slang
+++ b/tests/cooperative-vector/outer-product-structuredbuffer.slang
@@ -1,7 +1,7 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
// These platforms don't support these operations into structured buffers
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: half
diff --git a/tests/cooperative-vector/outer-product.slang b/tests/cooperative-vector/outer-product.slang
index f2c22fa84..21f133956 100644
--- a/tests/cooperative-vector/outer-product.slang
+++ b/tests/cooperative-vector/outer-product.slang
@@ -1,7 +1,7 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
// HLSL doesn't support the training operations
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// Disabled because of some pecularities stemming from our lowering of half to float
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
diff --git a/tests/cooperative-vector/reduce-sum-accumulate-structuredbuffer.slang b/tests/cooperative-vector/reduce-sum-accumulate-structuredbuffer.slang
index 2d843b8f3..fd7ade6ed 100644
--- a/tests/cooperative-vector/reduce-sum-accumulate-structuredbuffer.slang
+++ b/tests/cooperative-vector/reduce-sum-accumulate-structuredbuffer.slang
@@ -2,7 +2,7 @@
///TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// HLSL doesn't support the training operations
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: half
// CHECK-NEXT: 112.000000
diff --git a/tests/cooperative-vector/reduce-sum-accumulate.slang b/tests/cooperative-vector/reduce-sum-accumulate.slang
index 2d843b8f3..fd7ade6ed 100644
--- a/tests/cooperative-vector/reduce-sum-accumulate.slang
+++ b/tests/cooperative-vector/reduce-sum-accumulate.slang
@@ -2,7 +2,7 @@
///TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// HLSL doesn't support the training operations
-//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
// CHECK: type: half
// CHECK-NEXT: 112.000000
diff --git a/tests/cooperative-vector/scalar-mul.slang b/tests/cooperative-vector/scalar-mul.slang
index ee76a3fd5..f9fed6d7d 100644
--- a/tests/cooperative-vector/scalar-mul.slang
+++ b/tests/cooperative-vector/scalar-mul.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/simple.slang b/tests/cooperative-vector/simple.slang
index d7080e9d5..3729996af 100644
--- a/tests/cooperative-vector/simple.slang
+++ b/tests/cooperative-vector/simple.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/step.slang b/tests/cooperative-vector/step.slang
index ba6a184c1..620ad3398 100644
--- a/tests/cooperative-vector/step.slang
+++ b/tests/cooperative-vector/step.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/sub.slang b/tests/cooperative-vector/sub.slang
index c4a281a78..af7bd1c9b 100644
--- a/tests/cooperative-vector/sub.slang
+++ b/tests/cooperative-vector/sub.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/subscript.slang b/tests/cooperative-vector/subscript.slang
index 46aeb49a1..1a1550bc3 100644
--- a/tests/cooperative-vector/subscript.slang
+++ b/tests/cooperative-vector/subscript.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/tanh.slang b/tests/cooperative-vector/tanh.slang
index ec73c0851..15fecbfa5 100644
--- a/tests/cooperative-vector/tanh.slang
+++ b/tests/cooperative-vector/tanh.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// Hilariously low precision because the different APIs don't agree (they're
diff --git a/tests/cooperative-vector/unary.slang b/tests/cooperative-vector/unary.slang
index b60b984e9..f53f09a18 100644
--- a/tests/cooperative-vector/unary.slang
+++ b/tests/cooperative-vector/unary.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -xslang -skip-spirv-validation
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t
diff --git a/tests/cooperative-vector/variadic-init-cast.slang b/tests/cooperative-vector/variadic-init-cast.slang
index 2e0751b89..f156d2d05 100644
--- a/tests/cooperative-vector/variadic-init-cast.slang
+++ b/tests/cooperative-vector/variadic-init-cast.slang
@@ -1,5 +1,5 @@
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type -emit-spirv-directly
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: float
diff --git a/tests/cooperative-vector/variadic-init.slang b/tests/cooperative-vector/variadic-init.slang
index 6f7540a98..b4a2ea118 100644
--- a/tests/cooperative-vector/variadic-init.slang
+++ b/tests/cooperative-vector/variadic-init.slang
@@ -1,5 +1,5 @@
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk -render-feature cooperative-vector -output-using-type
-//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X.
+//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12 -render-feature cooperative-vector -dx12-experimental -use-dxil -output-using-type -profile cs_6_8 -Xslang... -Xdxc -Vd -X. -capability hlsl_coopvec_poc
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu -output-using-type
// CHECK: type: int32_t