codegenerated matrix logic
This commit is contained in:
@ -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)
|
||||
Reference in New Issue
Block a user