From c296538c15e50ea7182ea23b94cfbaee86a2315f Mon Sep 17 00:00:00 2001 From: Christoph Lehner Date: Sat, 7 Oct 2023 22:37:08 +0200 Subject: [PATCH] gpu fix --- lib/cgpt/lib/stencil/matrix.h | 4 ++-- lib/gpt/qcd/fermion/register.py | 32 ++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/cgpt/lib/stencil/matrix.h b/lib/cgpt/lib/stencil/matrix.h index 10d279639..ea52a73c8 100644 --- a/lib/cgpt/lib/stencil/matrix.h +++ b/lib/cgpt/lib/stencil/matrix.h @@ -174,7 +174,7 @@ class cgpt_stencil_matrix : public cgpt_stencil_matrix_base { } else { - Vector _buf; + Vector _buf; Vector _sview; int* stencil_map = &sm->stencil_map[0]; @@ -190,7 +190,7 @@ class cgpt_stencil_matrix : public cgpt_stencil_matrix_base { _sview.push_back(sm->stencils[i].View(AcceleratorRead)); } - obj_t** buf = &_buf[0]; + T** buf = &_buf[0]; CartesianStencilView_t* sview = &_sview[0]; // now loop diff --git a/lib/gpt/qcd/fermion/register.py b/lib/gpt/qcd/fermion/register.py index 93d42a0a8..8f065af2f 100644 --- a/lib/gpt/qcd/fermion/register.py +++ b/lib/gpt/qcd/fermion/register.py @@ -11,15 +11,25 @@ def register(reg, op): reg.Mdiag = lambda dst, src: op.apply_unary_operator(2009, dst, src) reg.Dminus = lambda dst, src: op.apply_unary_operator(2010, dst, src) reg.DminusDag = lambda dst, src: op.apply_unary_operator(2011, dst, src) - reg.ImportPhysicalFermionSource = lambda dst, src: op.apply_unary_operator(2012, dst, src) - reg.ImportUnphysicalFermion = lambda dst, src: op.apply_unary_operator(2013, dst, src) - reg.ExportPhysicalFermionSolution = lambda dst, src: op.apply_unary_operator(2014, dst, src) - reg.ExportPhysicalFermionSource = lambda dst, src: op.apply_unary_operator(2015, dst, src) + reg.ImportPhysicalFermionSource = lambda dst, src: op.apply_unary_operator( + 2012, dst, src + ) + reg.ImportUnphysicalFermion = lambda dst, src: op.apply_unary_operator( + 2013, dst, src + ) + reg.ExportPhysicalFermionSolution = lambda dst, src: op.apply_unary_operator( + 2014, dst, src + ) + reg.ExportPhysicalFermionSource = lambda dst, src: op.apply_unary_operator( + 2015, dst, src + ) reg.Dhop = lambda dst, src: op.apply_unary_operator(3001, dst, src) reg.DhopDag = lambda dst, src: op.apply_unary_operator(4001, dst, src) reg.DhopEO = lambda dst, src: op.apply_unary_operator(3002, dst, src) reg.DhopEODag = lambda dst, src: op.apply_unary_operator(4002, dst, src) - reg.Mdir = lambda dst, src, dir, disp: op.apply_dirdisp_operator(5001, dst, src, dir, disp) + reg.Mdir = lambda dst, src, dir, disp: op.apply_dirdisp_operator( + 5001, dst, src, dir, disp + ) reg.MDeriv = lambda mat, dst, src: op.apply_deriv_operator(6001, mat, dst, src) reg.MDerivDag = lambda mat, dst, src: op.apply_deriv_operator(7001, mat, dst, src) reg.MoeDeriv = lambda mat, dst, src: op.apply_deriv_operator(6002, mat, dst, src) @@ -27,8 +37,14 @@ def register(reg, op): reg.MeoDeriv = lambda mat, dst, src: op.apply_deriv_operator(6003, mat, dst, src) reg.MeoDerivDag = lambda mat, dst, src: op.apply_deriv_operator(7003, mat, dst, src) reg.DhopDeriv = lambda mat, dst, src: op.apply_deriv_operator(6004, mat, dst, src) - reg.DhopDerivDag = lambda mat, dst, src: op.apply_deriv_operator(7004, mat, dst, src) + reg.DhopDerivDag = lambda mat, dst, src: op.apply_deriv_operator( + 7004, mat, dst, src + ) reg.DhopDerivEO = lambda mat, dst, src: op.apply_deriv_operator(6005, mat, dst, src) - reg.DhopDerivEODag = lambda mat, dst, src: op.apply_deriv_operator(7005, mat, dst, src) + reg.DhopDerivEODag = lambda mat, dst, src: op.apply_deriv_operator( + 7005, mat, dst, src + ) reg.DhopDerivOE = lambda mat, dst, src: op.apply_deriv_operator(6006, mat, dst, src) - reg.DhopDerivOEDag = lambda mat, dst, src: op.apply_deriv_operator(7006, mat, dst, src) + reg.DhopDerivOEDag = lambda mat, dst, src: op.apply_deriv_operator( + 7006, mat, dst, src + )