Skip to content

Ensure the NRT is initialized prior to use in external NRT tests. - #7386

Merged
sklam merged 3 commits into
numba:masterfrom
stuartarchibald:fix/7385
Sep 16, 2021
Merged

sklam merged 3 commits into
numba:masterfrom
stuartarchibald:fix/7385

Conversation

@stuartarchibald

Copy link
Copy Markdown
Contributor

As title. Also updates the docs to remind users of the NRT
external API that the NRT must be initialized prior to use.

Fixes #7385

As title. Also updates the docs to remind users of the NRT
external API that the NRT must be initialized prior to use.

Fixes numba#7385
Comment thread numba/tests/test_nrt.py Outdated
def setUp(self):
# initialize the NRT (in case the tests are run in isolation)
super(TestNrtExternalCFFI, self).setUp()
cpu.CPUContext(typing.Context())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not create a new CPUContext. Better to use

from numba.core.registry import cpu_target
cpu_target.target_context

to force the initialization of the CPUContext

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I forgot this was recently changed. There's another instance of this in this test module, I'll fix that too.

Comment thread docs/source/developer/numba-runtime.rst Outdated
Comment on lines +185 to +187
from numba.core import typing, cpu
typingctx = typing.Context()
cpu.CPUContext(typingctx, 'cpu')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better not to suggest users to create a fresh CPUContext. They should get and initialize the singleton with numba.core.registry.cpu_target.target_context

@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Sep 9, 2021
@stuartarchibald stuartarchibald added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Sep 10, 2021
As title.
@esc esc added the Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm label Sep 13, 2021
@esc

esc commented Sep 13, 2021

Copy link
Copy Markdown
Member

BFID: numba_smoketest_cpu_yaml_45

@esc

esc commented Sep 15, 2021

Copy link
Copy Markdown
Member

BFID: numba_smoketest_cpu_yaml_45

The build farm had to be reconfigured for this. I am re-running the build now.

@esc

esc commented Sep 15, 2021

Copy link
Copy Markdown
Member

BFID: numba_smoketest_cpu_yaml_45

The build farm had to be reconfigured for this. I am re-running the build now.

It passed!

@esc esc added BuildFarm Passed For PRs that have been through the buildfarm and passed and removed Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm labels Sep 15, 2021
@stuartarchibald

Copy link
Copy Markdown
Contributor Author

BFID: numba_smoketest_cpu_yaml_45

The build farm had to be reconfigured for this. I am re-running the build now.

It passed!

Great, thanks for testing it again!

@sklam sklam added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Sep 15, 2021
@sklam
sklam merged commit 0f0edfa into numba:master Sep 16, 2021
sklam added a commit to sklam/numba that referenced this pull request Sep 22, 2021
Ensure the NRT is initialized prior to use in external NRT tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nrt_external API broken in 0.54

3 participants