Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions onnxruntime/core/providers/webgpu/shader_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,12 @@ namespace {
// Validate if the tensor element type matches the program variable data type
Status ValidateVariableDataType(int32_t element_type, ProgramVariableDataType var_type, bool is_atomic = false) {
if (is_atomic) {
// float32 is not a valid data type for atomic. However the data may be bitcast-ed to i32 and used to simulate atomic operation using atomicCompareExchangeWeak.
ORT_RETURN_IF_NOT(var_type == ProgramVariableDataType::Int32 || var_type == ProgramVariableDataType::Uint32 || var_type == ProgramVariableDataType::Float32,
// float32, float32x4 and float16x4 are not valid data types for atomic. However the data may be bitcast-ed to i32 and used to simulate atomic operation using atomicCompareExchangeWeak.
ORT_RETURN_IF_NOT(var_type == ProgramVariableDataType::Int32 ||
var_type == ProgramVariableDataType::Uint32 ||
var_type == ProgramVariableDataType::Float32 ||
var_type == ProgramVariableDataType::Float16x4 ||
var_type == ProgramVariableDataType::Float32x4,
"Unexpected program variable type ", int(var_type), " for atomic variable");
}

Expand Down
Loading