Skip to content

Commit

Permalink
#174 correct kind of globalsize and use c_sizeof to calculate device …
Browse files Browse the repository at this point in the history
…buffer size [skip ci]
  • Loading branch information
arporter committed Jul 20, 2018
1 parent d3fd8d5 commit 92b3319
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/psyclone/gocean1p0.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ def gen_ocl(self, parent):

garg = self._find_grid_access()
parent.add(DeclGen(parent, datatype="integer", target=True,
entity_decls=["globalsize(2)"]))
kind="c_size_t", entity_decls=["globalsize(2)"]))
parent.add(AssignGen(
parent, lhs="globalsize",
rhs="(/{0}%grid%nx, {0}%grid%ny/)".format(garg.name)))
Expand Down Expand Up @@ -816,8 +816,8 @@ def gen_ocl(self, parent):
kind="c_intptr_t", target=True,
entity_decls=["write_event"]))

size_expr = "int({0}%grid%nx*{0}%grid%ny, 8)*8_8".\
format(garg.name)
size_expr = "int({0}%grid%nx*{0}%grid%ny, 8)*c_sizeof({1}(1,1))".\
format(garg.name, host_buff)
ifthen.add(AssignGen(ifthen, lhs="size_in_bytes",
rhs=size_expr))
ifthen.add(CommentGen(ifthen, " Create buffer on device"))
Expand Down

0 comments on commit 92b3319

Please sign in to comment.