Skip to content
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

Remove jit options argument from ObjectCode #435

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
26 changes: 2 additions & 24 deletions cuda_core/cuda/core/experimental/_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,37 +128,15 @@ def __init__(self, module, code_type, jit_options=None, *, symbol_mapping=None):
def _lazy_load_module(self, *args, **kwargs):
if self._handle is not None:
return
jit_options = self._jit_options
module = self._module
if isinstance(module, str):
# TODO: this option is only taken by the new library APIs, but we have
# a bug that we can't easily support it just yet (NVIDIA/cuda-python#73).
if jit_options is not None:
raise ValueError
self._handle = handle_return(self._loader["file"](module))
else:
assert isinstance(module, bytes)
if jit_options is None:
jit_options = {}
if self._backend_version == "new":
args = (
module,
list(jit_options.keys()),
list(jit_options.values()),
len(jit_options),
# TODO: support library options
[],
[],
0,
)
self._handle = handle_return(self._loader["data"](module, [], [], 0, [], [], 0))
else: # "old" backend
args = (
module,
len(jit_options),
list(jit_options.keys()),
list(jit_options.values()),
)
self._handle = handle_return(self._loader["data"](*args))
self._handle = handle_return(self._loader["data"](module, 0, [], []))

@precondition(_lazy_load_module)
def get_kernel(self, name):
Expand Down
3 changes: 2 additions & 1 deletion cuda_core/docs/source/release/0.2.0-notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
``cuda.core`` 0.2.0 Release Notes
=================================

Released on <TODO>, 2024
Released on <TODO>, 2025

Highlights
----------
Expand All @@ -20,3 +20,4 @@ Breaking Changes

- Change ``__cuda_stream__`` from attribute to method
- The :meth:`~Program.compile` method no longer accepts the `options` argument. Instead, you can optionally pass an instance of :class:`~ProgramOptions` to the constructor of :obj:`~Program`.
- The internal constructor of :class:`~ObjectCode` no longer accepts the jit_options argument. Options are provided to upstream :class:`~ProgramOptions` or :class:`~LinkerOptions` instead.