Skip to content

Commit b364681

Browse files
committed
Regenerate on sdk-1.4.321.0
1 parent cfde035 commit b364681

18 files changed

+1129
-30
lines changed

autogen/external/SPIRV-Headers

Submodule SPIRV-Headers updated 95 files

autogen/src/structs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ pub enum Class {
153153
DeviceSideEnqueue,
154154
#[serde(rename = "Non-Uniform")]
155155
NonUniform,
156+
Tensor,
157+
Graph,
156158
Reserved,
157159
#[serde(rename = "@exclude")]
158160
Exclude,

rspirv/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rspirv"
3-
version = "0.12.0+sdk-1.4.313.0"
3+
version = "0.12.0+sdk-1.4.321.0"
44
authors = ["Lei Zhang <[email protected]>"]
55
edition = "2018"
66

rspirv/binary/assemble.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ impl Assemble for dr::Operand {
9494
Self::CooperativeMatrixReduce(v) => result.push(v.bits()),
9595
Self::TensorClampMode(v) => result.push(v as u32),
9696
Self::TensorAddressingOperands(v) => result.push(v.bits()),
97+
Self::TensorOperands(v) => result.push(v.bits()),
9798
Self::InitializationModeQualifier(v) => result.push(v as u32),
9899
Self::LoadCacheControl(v) => result.push(v as u32),
99100
Self::StoreCacheControl(v) => result.push(v as u32),

rspirv/binary/autogen_decode_operand.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,15 @@ impl Decoder<'_> {
602602
Err(Error::StreamExpected(self.offset))
603603
}
604604
}
605+
#[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V TensorOperands value."]
606+
pub fn tensor_operands(&mut self) -> Result<spirv::TensorOperands> {
607+
if let Ok(word) = self.word() {
608+
spirv::TensorOperands::from_bits(word).ok_or(Error::TensorOperandsUnknown(
609+
self.offset - WORD_NUM_BYTES,
610+
word,
611+
))
612+
} else {
613+
Err(Error::StreamExpected(self.offset))
614+
}
615+
}
605616
}

rspirv/binary/autogen_disas_operand.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,27 @@ impl Disassemble for spirv::MatrixMultiplyAccumulateOperands {
481481
bits.join("|")
482482
}
483483
}
484+
impl Disassemble for spirv::TensorOperands {
485+
fn disassemble(&self) -> String {
486+
if self.is_empty() {
487+
return "None".to_string();
488+
}
489+
let mut bits = vec![];
490+
if self.contains(spirv::TensorOperands::NONTEMPORAL_ARM) {
491+
bits.push("NontemporalARM")
492+
}
493+
if self.contains(spirv::TensorOperands::OUT_OF_BOUNDS_VALUE_ARM) {
494+
bits.push("OutOfBoundsValueARM")
495+
}
496+
if self.contains(spirv::TensorOperands::MAKE_ELEMENT_AVAILABLE_ARM) {
497+
bits.push("MakeElementAvailableARM")
498+
}
499+
if self.contains(spirv::TensorOperands::MAKE_ELEMENT_VISIBLE_ARM) {
500+
bits.push("MakeElementVisibleARM")
501+
}
502+
if self.contains(spirv::TensorOperands::NON_PRIVATE_ELEMENT_ARM) {
503+
bits.push("NonPrivateElementARM")
504+
}
505+
bits.join("|")
506+
}
507+
}

rspirv/binary/autogen_error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub enum Error {
6565
FPEncodingUnknown(usize, spirv::Word),
6666
CooperativeVectorMatrixLayoutUnknown(usize, spirv::Word),
6767
ComponentTypeUnknown(usize, spirv::Word),
68+
TensorOperandsUnknown(usize, spirv::Word),
6869
#[doc = r"Failed to decode a string."]
6970
#[doc = r""]
7071
#[doc = r"For structured error handling, the second element could be"]
@@ -359,6 +360,11 @@ impl fmt::Display for Error {
359360
"unknown value {} for operand kind ComponentType at index {}",
360361
word, index
361362
),
363+
Error::TensorOperandsUnknown(index, word) => write!(
364+
f,
365+
"unknown value {} for operand kind TensorOperands at index {}",
366+
word, index
367+
),
362368
Error::DecodeStringFailed(index, ref e) => {
363369
write!(f, "cannot decode string at index {}: {}", index, e)
364370
}

rspirv/binary/autogen_parse_operand.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ impl Parser<'_, '_> {
198198
ops.append(&mut self.parse_tensor_addressing_operands_arguments(val)?);
199199
ops
200200
}
201+
GOpKind::TensorOperands => {
202+
let val = self.decoder.tensor_operands()?;
203+
let mut ops = vec![dr::Operand::TensorOperands(val)];
204+
ops.append(&mut self.parse_tensor_operands_arguments(val)?);
205+
ops
206+
}
201207
GOpKind::IdResultType => panic!(),
202208
GOpKind::IdResult => panic!(),
203209
GOpKind::LiteralContextDependentNumber => panic!(),
@@ -678,4 +684,20 @@ impl Parser<'_, '_> {
678684
}
679685
Ok(params)
680686
}
687+
fn parse_tensor_operands_arguments(
688+
&mut self,
689+
tensor_operands: spirv::TensorOperands,
690+
) -> Result<Vec<dr::Operand>> {
691+
let mut params = vec![];
692+
if tensor_operands.contains(spirv::TensorOperands::OUT_OF_BOUNDS_VALUE_ARM) {
693+
params.append(&mut vec![dr::Operand::IdRef(self.decoder.id()?)]);
694+
}
695+
if tensor_operands.contains(spirv::TensorOperands::MAKE_ELEMENT_AVAILABLE_ARM) {
696+
params.append(&mut vec![dr::Operand::IdRef(self.decoder.id()?)]);
697+
}
698+
if tensor_operands.contains(spirv::TensorOperands::MAKE_ELEMENT_VISIBLE_ARM) {
699+
params.append(&mut vec![dr::Operand::IdRef(self.decoder.id()?)]);
700+
}
701+
Ok(params)
702+
}
681703
}

0 commit comments

Comments
 (0)