Skip to content

Commit

Permalink
Update massage_args method to fix issues with pyopencl
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapb committed Feb 16, 2019
1 parent 965d0d7 commit e2d75fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compyle/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def _generate_kernel(self, *args):
def _massage_arg(self, x):
if isinstance(x, array.Array):
return x.dev
elif isinstance(x, np.ndarray):
elif self.backend != 'cuda' or isinstance(x, np.ndarray):
return x
else:
return np.asarray(x)
Expand Down Expand Up @@ -353,7 +353,7 @@ def _generate_kernel(self, *args):
def _massage_arg(self, x):
if isinstance(x, array.Array):
return x.dev
elif isinstance(x, np.ndarray):
elif self.backend != 'cuda' or isinstance(x, np.ndarray):
return x
else:
return np.asarray(x)
Expand Down Expand Up @@ -459,7 +459,7 @@ def _generate_kernel(self, **kwargs):
def _massage_arg(self, x):
if isinstance(x, array.Array):
return x.dev
elif isinstance(x, np.ndarray):
elif self.backend != 'cuda' or isinstance(x, np.ndarray):
return x
else:
return np.asarray(x)
Expand Down

0 comments on commit e2d75fc

Please sign in to comment.