Skip to content

Commit

Permalink
Disable host callbacks if no MLIR translation rule is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
flferretti committed Jan 5, 2025
1 parent 8382d68 commit 356a33d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/jaxsim/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ def raise_if(
**kwargs: The keyword arguments to fill the format string
"""

# Disable host callback if running on TPU.
if jax.devices()[0].platform == "tpu" or os.environ.get(
"JAXSIM_DISABLE_EXCEPTIONS", 0
# Disable host callback if running on unsupported hardware or if the user
# explicitly disabled it.
if jax.devices()[0].platform in {"tpu", "METAL"} or os.environ.get(
"JAXSIM_DISABLE_EXCEPTIONS", "0"
):
return

Expand Down

0 comments on commit 356a33d

Please sign in to comment.