Skip to content

Commit 59a00a6

Browse files
committed
Avoid errors when AF_BACKEND_DEFAULT passed to direct linked backend
1 parent 714430e commit 59a00a6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/api/c/device.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ using common::half;
2828

2929
af_err af_set_backend(const af_backend bknd) {
3030
try {
31-
if (bknd != getBackend()) { return AF_ERR_ARG; }
31+
if (bknd != getBackend() && bknd != AF_BACKEND_DEFAULT) {
32+
return AF_ERR_ARG;
33+
}
3234
}
3335
CATCHALL;
3436

0 commit comments

Comments
 (0)