Skip to content

Commit

Permalink
Rename alpha/beta in library node to avoid clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
tbennun committed Aug 30, 2023
1 parent 602220e commit 5f6e371
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dace/libraries/blas/nodes/gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ def expansion(node, state, sdfg):
code = ''
if dtype in (dace.complex64, dace.complex128):
code = f'''
{dtype.ctype} alpha = {alpha};
{dtype.ctype} beta = {beta};
{dtype.ctype} __alpha = {alpha};
{dtype.ctype} __beta = {beta};
'''
opt['alpha'] = '&alpha'
opt['beta'] = '&beta'
opt['alpha'] = '&__alpha'
opt['beta'] = '&__beta'

code += ("cblas_{func}(CblasColMajor, {ta}, {tb}, "
"{M}, {N}, {K}, {alpha}, {x}, {lda}, {y}, {ldb}, {beta}, "
Expand Down Expand Up @@ -287,12 +287,12 @@ def expansion(cls, node, state, sdfg):

# Set pointer mode to host
call_prefix += f'''{cls.set_pointer_mode}(__dace_{cls.backend}blas_handle, {cls.pointer_host});
{dtype.ctype} alpha = {alpha};
{dtype.ctype} beta = {beta};
{dtype.ctype} __alpha = {alpha};
{dtype.ctype} __beta = {beta};
'''
call_suffix += f'''{cls.set_pointer_mode}(__dace_{cls.backend}blas_handle, {cls.pointer_device});'''
alpha = f'({cdtype} *)&alpha'
beta = f'({cdtype} *)&beta'
alpha = f'({cdtype} *)&__alpha'
beta = f'({cdtype} *)&__beta'
else:
alpha = constants[node.alpha]
beta = constants[node.beta]
Expand Down

0 comments on commit 5f6e371

Please sign in to comment.