Skip to content

Commit b34bb51

Browse files
committed
Fix int64 to long long conversion on windows
1 parent 207addb commit b34bb51

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

numba_dppy/dppy_host_fn_call_gen.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _init_llvm_types_and_constants(self):
5252
self.byte_ptr_t = lc.Type.pointer(self.byte_t)
5353
self.byte_ptr_ptr_t = lc.Type.pointer(self.byte_ptr_t)
5454
self.intp_t = self.context.get_value_type(types.intp)
55-
self.long_t = self.context.get_value_type(types.int64)
55+
self.int64_t = self.context.get_value_type(types.int64)
5656
self.int32_t = self.context.get_value_type(types.int32)
5757
self.int32_ptr_t = lc.Type.pointer(self.int32_t)
5858
self.uintp_t = self.context.get_value_type(types.uintp)
@@ -113,23 +113,26 @@ def allocate_kenrel_arg_array(self, num_kernel_args):
113113

114114

115115
def resolve_and_return_dpctl_type(self, ty):
116+
"""This function looks up the dpctl defined enum values from DPCTLKernelArgType.
117+
"""
118+
116119
val = None
117120
if ty == types.int32 or isinstance(ty, types.scalars.IntegerLiteral):
118-
val = self.context.get_constant(types.int32, 4)
121+
val = self.context.get_constant(types.int32, 9) # DPCTL_LONG_LONG
119122
elif ty == types.uint32:
120-
val = self.context.get_constant(types.int32, 5)
123+
val = self.context.get_constant(types.int32, 10) # DPCTL_UNSIGNED_LONG_LONG
121124
elif ty == types.boolean:
122-
val = self.context.get_constant(types.int32, 5)
125+
val = self.context.get_constant(types.int32, 5) # DPCTL_UNSIGNED_INT
123126
elif ty == types.int64:
124-
val = self.context.get_constant(types.int32, 7)
127+
val = self.context.get_constant(types.int32, 9) # DPCTL_LONG_LONG
125128
elif ty == types.uint64:
126-
val = self.context.get_constant(types.int32, 8)
129+
val = self.context.get_constant(types.int32, 11) # DPCTL_SIZE_T
127130
elif ty == types.float32:
128-
val = self.context.get_constant(types.int32, 12)
131+
val = self.context.get_constant(types.int32, 12) # DPCTL_FLOAT
129132
elif ty == types.float64:
130-
val = self.context.get_constant(types.int32, 13)
133+
val = self.context.get_constant(types.int32, 13) # DPCTL_DOUBLE
131134
elif ty == types.voidptr:
132-
val = self.context.get_constant(types.int32, 15)
135+
val = self.context.get_constant(types.int32, 15) # DPCTL_VOID_PTR
133136
else:
134137
raise NotImplementedError
135138

@@ -151,12 +154,12 @@ def process_kernel_arg(self, var, llvm_arg, arg_type, gu_sig, val_type, index, m
151154
if llvm_arg is None:
152155
raise NotImplementedError(arg_type, var)
153156

154-
storage = cgutils.alloca_once(self.builder, self.long_t)
157+
storage = cgutils.alloca_once(self.builder, self.int64_t)
155158
self.builder.store(self.context.get_constant(types.int64, 0), storage)
156159
ty = self.resolve_and_return_dpctl_type(types.int64)
157160
self.form_kernel_arg_and_arg_ty(self.builder.bitcast(storage, self.void_ptr_t), ty)
158161

159-
storage = cgutils.alloca_once(self.builder, self.long_t)
162+
storage = cgutils.alloca_once(self.builder, self.int64_t)
160163
self.builder.store(self.context.get_constant(types.int64, 0), storage)
161164
ty = self.resolve_and_return_dpctl_type(types.int64)
162165
self.form_kernel_arg_and_arg_ty(self.builder.bitcast(storage, self.void_ptr_t), ty)

numba_dppy/tests/test_with_context.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
class TestWithDPPYContext(DPPYTestCase):
1313

1414
@unittest.skipIf(not dpctl.has_gpu_queues(), "No GPU platforms available")
15-
@expectedFailureIf(sys.platform.startswith('win'))
1615
def test_with_dppy_context_gpu(self):
1716

1817
@njit

0 commit comments

Comments
 (0)