codegenerated matrix logic

This commit is contained in:
2026-04-13 11:42:40 -04:00
parent 978dad618f
commit 17a1c3f84a
30 changed files with 6468 additions and 1291 deletions

View File

@ -523,7 +523,7 @@ def mconstructor2(dim,dtype):
for I in range(0,dim):
lnsh+="\t\t"
for J in range(0,dim):
lnsh += f"const {dtype}& _m{J}{I}"
lnsh += f"const {dtype}& _m{I}{J}"
if(J+I*dim<dim*dim-1):
lnsh+=", "
lnsh+="\n"
@ -533,7 +533,7 @@ def mconstructor2(dim,dtype):
for I in range(0,dim):
lnss+="\t\t"
for J in range(0,dim):
lnss += f"const {dtype}& _m{J}{I}"
lnss += f"const {dtype}& _m{I}{J}"
if(J+I*dim<dim*dim-1):
lnss+=", "
lnss+="\n"
@ -1080,12 +1080,9 @@ def genmatrixstuff(dim,dtype):
return [lnsh,lnss]
if(__name__=="__main__"):
dim = 2
dtype = "float"
genheader = "./test_scripts/{}_codegen1.hpp".format(vtypename(dim,dtype))
gensource = "./test_scripts/{}_codegen1.cu".format(vtypename(dim,dtype))
def gencode(dim,dtype):
genheader = "./test_scripts/cuvec_codegen/{}_codegen1.hpp".format(vtypename(dim,dtype))
gensource = "./test_scripts/cuvec_codegen/{}_codegen1.cu".format(vtypename(dim,dtype))
lnsh = ""
lnss = ""
@ -1098,7 +1095,12 @@ if(__name__=="__main__"):
fwrite(genheader,lnsh)
fwrite(gensource,lnss)
#lns = genvecheaderv1(dim,dtype)
#print(lns)
if(__name__=="__main__"):
dim = 4
dtype = "int"
for I in range(2,5):
for d in ["float","double","int"]:
gencode(I,d)