Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix problems with division under Python 3.

  • Loading branch information...
commit 0fc9d11558b9d24ab3794a58f980f95a7572a742 1 parent 727b9a5
@rybaktomasz rybaktomasz authored
Showing with 5 additions and 5 deletions.
  1. +4 −4 pycuda/curandom.py
  2. +1 −1  pycuda/gpuarray.py
View
8 pycuda/curandom.py
@@ -476,13 +476,13 @@ def fill_normal(self, data, stream=None):
data_size = data.size
if self.has_box_muller and data_size % 2 == 0:
func_name += "2"
- data_size /= 2
+ data_size //= 2
func = self.generators[func_name]
func.prepared_async_call(
(self.block_count, 1), (self.generators_per_block, 1, 1), stream,
- self.state, data.gpudata, data_size)
+ self.state, data.gpudata, int(data_size))
def gen_uniform(self, shape, dtype, stream=None):
result = array.empty(shape, dtype)
@@ -506,13 +506,13 @@ def fill_log_normal(self, data, mean, stddev, stream=None):
data_size = data.size
if self.has_box_muller and data_size % 2 == 0:
func_name += "2"
- data_size /= 2
+ data_size //= 2
func = self.generators[func_name]
func.prepared_async_call(
(self.block_count, 1), (self.generators_per_block, 1, 1), stream,
- self.state, data.gpudata, mean, stddev, data_size)
+ self.state, data.gpudata, mean, stddev, int(data_size))
def gen_log_normal(self, shape, dtype, mean, stddev, stream=None):
result = array.empty(shape, dtype)
View
2  pycuda/gpuarray.py
@@ -487,7 +487,7 @@ def __rdiv__(self, other):
result = self._new_like_me(_get_common_dtype(self, other))
return self._rdiv_scalar(other, result)
- __rtruediv__ = __div__
+ __rtruediv__ = __rdiv__
def __idiv__(self, other):
"""Divides an array by an array or a scalar::
Please sign in to comment.
Something went wrong with that request. Please try again.