-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #353 from guilhermeleobas/numba54
Tests for Numba 0.54.0 RC3
- Loading branch information
Showing
13 changed files
with
696 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
name: rbc | ||
channels: | ||
- conda-forge | ||
- numba | ||
- defaults | ||
dependencies: | ||
- python>=3.7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from rbc.utils import get_version | ||
from numba.core import cgutils | ||
from llvmlite import ir | ||
|
||
|
||
int8_t = ir.IntType(8) | ||
int32_t = ir.IntType(32) | ||
int64_t = ir.IntType(64) | ||
void_t = ir.VoidType() | ||
fp32 = ir.FloatType() | ||
fp64 = ir.DoubleType() | ||
|
||
|
||
def get_or_insert_function(module, fnty, name=None): | ||
if get_version('numba') >= (0, 54): | ||
fn = cgutils.get_or_insert_function( | ||
module, fnty, name=name) | ||
else: | ||
fn = module.get_or_insert_function( | ||
fnty, name=name) | ||
return fn | ||
|
||
|
||
def get_member_value(builder, data, idx): | ||
if get_version('numba') >= (0, 54): | ||
assert data.opname == 'insertvalue', data.opname | ||
return builder.extract_value(data, [idx]) | ||
else: | ||
assert data.opname == 'load', data.opname | ||
struct = data.operands[0] | ||
return builder.load(builder.gep(struct, [int32_t(0), int32_t(idx)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.