Skip to content

Commit

Permalink
PEP8 elementwise
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 19, 2014
1 parent f194beb commit d5a715c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pycuda/elementwise.py
Expand Up @@ -273,10 +273,10 @@ def get_take_put_kernel(dtype, idx_dtype, with_offsets, vec_count=1):
VectorArg(idx_dtype, "gmem_src_idx"),
] + [
VectorArg(dtype, "dest%d" % i)
for i in range(vec_count)
for i in range(vec_count)
] + [
ScalarArg(idx_dtype, "offset%d" % i)
for i in range(vec_count) if with_offsets
for i in range(vec_count) if with_offsets
] + [ScalarArg(np.intp, "n")]

preamble = "#include <pycuda-helpers.hpp>\n\n" + "\n".join(
Expand Down Expand Up @@ -320,10 +320,10 @@ def get_put_kernel(dtype, idx_dtype, vec_count=1):
VectorArg(idx_dtype, "gmem_dest_idx"),
] + [
VectorArg(dtype, "dest%d" % i)
for i in range(vec_count)
for i in range(vec_count)
] + [
VectorArg(dtype, "src%d" % i)
for i in range(vec_count)
for i in range(vec_count)
] + [ScalarArg(np.intp, "n")]

body = (
Expand Down Expand Up @@ -451,6 +451,7 @@ def get_binary_func_kernel(func, dtype_x, dtype_y, dtype_z):
"z[i] = %s(x[i], y[i])" % func,
func+"_kernel")


@context_dependent_memoize
def get_binary_func_scalar_kernel(func, dtype_x, dtype_y, dtype_z):
return get_elwise_kernel(
Expand All @@ -462,8 +463,9 @@ def get_binary_func_scalar_kernel(func, dtype_x, dtype_y, dtype_z):
"z[i] = %s(x[i], y)" % func,
func+"_kernel")


def get_binary_minmax_kernel(func, dtype_x, dtype_y, dtype_z, use_scalar):
if not np.float64 in [dtype_x, dtype_y]:
if np.float64 not in [dtype_x, dtype_y]:
func = func + "f"

from pytools import any
Expand Down

0 comments on commit d5a715c

Please sign in to comment.