Skip to content

Is get_target_language needed #1368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
williambdean opened this issue Apr 18, 2025 · 0 comments
Open

Is get_target_language needed #1368

williambdean opened this issue Apr 18, 2025 · 0 comments

Comments

@williambdean
Copy link
Contributor

This function is used for the CAReduce

def get_target_language(mode=None) -> tuple[Literal["py", "c", "numba", "jax"], ...]:
"""Get the compilation target language."""
if mode is None:
mode = get_default_mode()
linker = mode.linker
if isinstance(linker, NumbaLinker):
return ("numba",)
if isinstance(linker, JAXLinker):
return ("jax",)
if isinstance(linker, PerformLinker):
return ("py",)
if isinstance(linker, CLinker):
return ("c",)
if isinstance(linker, MLXLinker):
return ("py",)
if isinstance(linker, VMLinker | OpWiseCLinker):
return ("c", "py") if config.cxx else ("py",)
raise Exception(f"Unsupported Linker: {linker}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant