Skip to content
Merged
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
17 changes: 15 additions & 2 deletions include/cudnn_frontend_Operation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1806,8 +1806,21 @@ class OperationBuilder_v8 {
}

#if (CUDNN_VERSION >= 92200)
// Set reshape mode if it's not NOT_SET
if (m_operation.reshape_mode != ReshapeMode_t::NOT_SET) {
// Same runtime-vs-compile-time split as cudnn_frontend/node/reshape.h. The attribute does
// not exist before 9.22 and setting it there returns BAD_PARAM. This builder is worse off
// than the graph API: reshape_mode defaults to VIEW_ONLY rather than NOT_SET, so the guard
// below is always true and every legacy reshape sends the attribute to whatever runtime is
// loaded. A pre-9.22 reshape is view-only by construction, so only an explicit LOGICAL
// request has to be refused rather than silently downgraded.
if (detail::get_backend_version() < 92200) {
if (m_operation.reshape_mode == ReshapeMode_t::LOGICAL) {
set_error_and_throw_exception(
&m_operation,
CUDNN_STATUS_NOT_SUPPORTED,
"CUDNN_BACKEND_OPERATION: ReshapeMode_t::LOGICAL requires a cuDNN 9.22 or newer runtime");
return std::move(m_operation);
}
} else if (m_operation.reshape_mode != ReshapeMode_t::NOT_SET) {
cudnnBackendReshapeMode_t cudnn_reshape_mode;
status = detail::convert_to_cudnn_type(m_operation.reshape_mode, cudnn_reshape_mode);
if (status == CUDNN_STATUS_SUCCESS) {
Expand Down