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

Mark optimized abs() as being nogil-safe. #2748

Merged
merged 1 commit into from Dec 14, 2018
Merged

Conversation

QuLogic
Copy link
Contributor

@QuLogic QuLogic commented Dec 7, 2018

I'm not entirely sure how to get the single test file to run, so I'm not sure if they're written correctlyy, but at least it compiles.

Fixes #2746.

@scoder
Copy link
Contributor

scoder commented Dec 7, 2018

Thanks. Looks like your changes broke the int_abs() and long_abs() tests. To run the builtin_abs tests separately, just pass that name to runtests.py as an argument, e.g.
python3 runtests.py --debug -vv builtin_abs

Regarding the implementation, I think it would be nicer if nogil=True was just a new keyword argument to BuiltinFunction, which means adding it as a constructor argument to the Signature class in TypeSlots.py, and build the appropriate CFuncType in Signature.function_type().

PyrexTypes.CFuncTypeArg(
"arg", PyrexTypes.c_long_type, None)
],
is_strict_signature=True, nogil=True)),
BuiltinFunction('abs', None, None, "__Pyx_abs_longlong",
Copy link
Contributor

Choose a reason for hiding this comment

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

nogil=True also applies here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It already has it; that's where I found the CFuncType setup originally.

@QuLogic
Copy link
Contributor Author

QuLogic commented Dec 8, 2018

To run the builtin_abs tests separately, just pass that name to runtests.py as an argument, e.g.

Ah, I tried passing the filename instead.

@scoder scoder added this to the 3.0 milestone Dec 14, 2018
@scoder
Copy link
Contributor

scoder commented Dec 14, 2018

Perfect! Thanks!

@scoder scoder merged commit d3aeb43 into cython:master Dec 14, 2018
@QuLogic QuLogic deleted the abs-nogil branch December 15, 2018 08:57
@scoder scoder changed the title Mark optimized abs as being nogil-safe. Mark optimized abs() as being nogil-safe. Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimized abs should be nogil-safe
2 participants