Commit 93b9dad7 authored by Jean-Matthieu Gallard's avatar Jean-Matthieu Gallard
Browse files

KernelGen AoSoA2 - working kernel (tested with Curvilinear Wholespace)

parent e428545f
......@@ -175,6 +175,7 @@ class Controller:
context["nDataPad"] = self.getSizeWithPadding(context["nData"])
context["nDofPad"] = self.getSizeWithPadding(context["nDof"])
context["nDof3D"] = 1 if context["nDim"] == 2 else context["nDof"]
context["nDof2Pad"] = self.getSizeWithPadding(context["nDof"]*context["nDof"])
context["solverHeader"] = context["solverName"].split("::")[1] + ".h"
context["codeNamespaceList"] = context["codeNamespace"].split("::")
context["guardNamespace"] = "_".join(context["codeNamespaceList"]).upper()
......
......@@ -100,6 +100,7 @@ class FusedSpaceTimePredictorVolumeIntegralModel(AbstractModelBaseClass):
nDof3 = nDof2*nDof
nDof3D = self.context["nDof3D"]
nDofPad = self.context["nDofPad"]
nDof2Pad = self.context["nDof2Pad"]
nDim = self.context["nDim"]
if self.context["isLinear"]:
......@@ -107,19 +108,22 @@ class FusedSpaceTimePredictorVolumeIntegralModel(AbstractModelBaseClass):
if self.context["useVectPDE"]:
if self.context["useAoSoA2"]: #split_ck aosoa2
if self.context["useFlux"]:
self.context["matmulConfigs"]["flux_x_sck"] = MatmulConfig(nVarPad, nDof, nDof, nVarPad , nDofPad, nVarPad , 1, 1, 1, 1, "flux_x_sck", "nopf", "gemm")
self.context["matmulConfigs"]["flux_y_sck"] = MatmulConfig(nVarPad, nDof, nDof, nVarPad , nDofPad, nVarPad*nDof , 1, 1, 1, 1, "flux_y_sck", "nopf", "gemm")
if self.context["nDim"]>=3:
self.context["matmulConfigs"]["flux_z_sck"] = MatmulConfig(nVarPad, nDof, nDof, nVarPad , nDofPad, nVarPad*nDof2, 1, 1, 1, 1, "flux_z_sck", "nopf", "gemm")
self.context["matmulConfigs"]["gradQ_x_sck"] = MatmulConfig(nVarPad, nDof, nDof, nVarPad , nDofPad, nVarPad , 1, 0, 1, 1, "gradQ_x_sck", "nopf", "gemm") # beta, 0 => overwrite C
self.context["matmulConfigs"]["gradQ_y_sck"] = MatmulConfig(nVarPad, nDof, nDof, nVarPad*nDof , nDofPad, nVarPad*nDof , 1, 0, 1, 1, "gradQ_y_sck", "nopf", "gemm") # beta, 0 => overwrite C
if self.context["nDim"]>=3:
self.context["matmulConfigs"]["gradQ_z_sck"] = MatmulConfig(nVarPad, nDof, nDof, nVarPad*nDof2, nDofPad, nVarPad*nDof2, 1, 0, 1, 1, "gradQ_z_sck", "nopf", "gemm") # beta, 0 => overwrite C
if self.context["useMaterialParam"]:
self.context["matmulConfigs"]["flux_x_sck_aosoa2"] = MatmulConfig(nDof, nDof, nDof, nDofPad , nDof, nDof , 1, 0, 1, 1, "flux_x_sck_aosoa2", "nopf", "gemm") # beta, 0 => overwrite C
self.context["matmulConfigs"]["flux_y_sck_aosoa2"] = MatmulConfig(nDof, nDof, nDof, nDof , nDofPad, nDof , 1, 0, 1, 1, "flux_y_sck_aosoa2", "nopf", "gemm") # beta, 0 => overwrite C
self.context["matmulConfigs"]["flux_z_sck_aosoa2"] = MatmulConfig(nDof2Pad*nVar, nDof, nDof, nDof2Pad*nVar , nDofPad, nDof2Pad*nVar , 1, 0, 1, 1, "flux_z_sck_aosoa2", "nopf", "gemm") # beta, 0 => overwrite C
else:
self.context["matmulConfigs"]["flux_x_sck_aosoa2"] = MatmulConfig(nDof, nDof, nDof, nDofPad , nDof, nDof , 1, 1, 1, 1, "flux_x_sck_aosoa2", "nopf", "gemm")
self.context["matmulConfigs"]["flux_y_sck_aosoa2"] = MatmulConfig(nDof, nDof, nDof, nDof , nDofPad, nDof , 1, 1, 1, 1, "flux_y_sck_aosoa2", "nopf", "gemm")
self.context["matmulConfigs"]["flux_z_sck_aosoa2"] = MatmulConfig(nDof2Pad*nVar, nDof, nDof, nDof2Pad*nVar , nDofPad, nDof2Pad*nVar , 1, 1, 1, 1, "flux_z_sck_aosoa2", "nopf", "gemm")
self.context["matmulConfigs"]["gradQ_x_sck_aosoa2"] = MatmulConfig(nDof, nDof, nDof, nDofPad , nDof, nDof , 1, 0, 1, 1, "gradQ_x_sck_aosoa2", "nopf", "gemm") # beta, 0 => overwrite C
self.context["matmulConfigs"]["gradQ_y_sck_aosoa2"] = MatmulConfig(nDof, nDof, nDof, nDof , nDofPad, nDof , 1, 0, 1, 1, "gradQ_y_sck_aosoa2", "nopf", "gemm") # beta, 0 => overwrite C
self.context["matmulConfigs"]["gradQ_z_sck_aosoa2"] = MatmulConfig(nDof2Pad*nVar, nDof, nDof, nDof2Pad*nVar, nDofPad, nDof2Pad*nVar, 1, 0, 1, 1, "gradQ_z_sck_vect", "nopf", "gemm") # beta, 0 => overwrite C
else:# split_ck vect
if self.context["useFlux"]:
if self.context["useMaterialParam"]:
self.context["matmulConfigs"]["flux_x_sck_vect"] = MatmulConfig(nDofPad, nVar, nDof, nDofPad , nDofPad, nDofPad , 1, 0, 1, 1, "flux_x_sck_vect", "nopf", "gemm")
self.context["matmulConfigs"]["flux_y_or_z_sck_vect"] = MatmulConfig(nDofPad*nVar, nVar, nDof, nDofPad*nVar , nDofPad, nDofPad*nVar , 1, 0, 1, 1, "flux_y_or_z_sck_vect", "nopf", "gemm")
self.context["matmulConfigs"]["flux_x_sck_vect"] = MatmulConfig(nDofPad, nVar, nDof, nDofPad , nDofPad, nDofPad , 1, 0, 1, 1, "flux_x_sck_vect", "nopf", "gemm") # beta, 0 => overwrite C
self.context["matmulConfigs"]["flux_y_or_z_sck_vect"] = MatmulConfig(nDofPad*nVar, nVar, nDof, nDofPad*nVar , nDofPad, nDofPad*nVar , 1, 0, 1, 1, "flux_y_or_z_sck_vect", "nopf", "gemm") # beta, 0 => overwrite C
else:
self.context["matmulConfigs"]["flux_x_sck_vect"] = MatmulConfig(nDofPad, nVar, nDof, nDofPad , nDofPad, nDofPad , 1, 1, 1, 1, "flux_x_sck_vect", "nopf", "gemm")
self.context["matmulConfigs"]["flux_y_sck_vect"] = MatmulConfig(nDofPad*nVar, nDof, nDof, nDofPad*nVar , nDofPad, nDofPad*nVar , 1, 1, 1, 1, "flux_y_sck_vect", "nopf", "gemm")
......
......@@ -27,14 +27,15 @@ namespace {{namespaceName}} {
constexpr int getBasisSize() {return {{nDof}};}
constexpr int getBasisSizePadded() {return {{nDofPad}};}
constexpr int getBasisSquaredSizePadded() {return {{nDof2Pad}};}
constexpr int getDimension() {return {{nDim}};}
constexpr bool isLinear() {return {{isLinearCText}};}
// Vect methods configuration
constexpr int getVectStride() {return {{nDofPad}};}
constexpr int getVectLength() {return {{nDof}};}
constexpr int getVectStride() {return {{nDof2Pad if useAoSoA2 else nDofPad}};}
constexpr int getVectLength() {return {{nDof*nDof if useAoSoA2 else nDof}};}
// Array sizes
constexpr int getlQiSize() {return {{lQiSize}};}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment