dummy assembler command on windows
@@ -23,6 +23,7 @@ from SolutionStructs import Solution
from Common import globalParameters, kernelLanguageIsSource, pushWorkingPath, popWorkingPath, printWarning, printExit, print1, print2, HR
import abc
from os import path, chmod
+from os import name as osname
from subprocess import Popen
################################################################################
@@ -1764,24 +1765,32 @@ class KernelWriter:
assemblyFile.close()
# assembler script
- assemblerFileName = path.join(globalParameters["WorkingPath"], "asm.sh")
+ assemblerFileName = path.join(globalParameters["WorkingPath"], \
+ "asm.%s"%("bat" if osname=="nt" else "sh"))
if not path.isfile(assemblerFileName):
assemblerFile = open(assemblerFileName, "w")
+ if osname == "nt":
+ assemblerFile.write("echo Windows: Copying instead of Assembling\n")
+ assemblerFile.write("copy %1.s %1.o\n")
+ assemblerFile.write("copy %1.o %1.co\n")
+ else:
assemblerFile.write("#!/bin/sh\n")
assemblerFile.write("ASM=%s\n"%globalParameters["AssemblerPath"])
- assemblerFile.write("${ASM} -x assembler -target amdgcn--amdhsa -mcpu=gfx%u%u%u -c -o $1.o $1.s\n"%(self.versionMajor, self.versionMinor, self.versionStep))
+ assemblerFile.write("${ASM} -x assembler -target amdgcn--amdhsa -mcpu=gfx%u%u%u -c -o $1.o $1.s\n" \
+ % (self.versionMajor, self.versionMinor, self.versionStep))
assemblerFile.write("${ASM} -target amdgcn--amdhsa $1.o -o $1.co\n")
assemblerFile.close()
chmod(assemblerFileName, 0777)
-
# run assembler
assemblerCommand = [assemblerFileName, kernelName]
print2("# Assembling %s: %s" % (kernelName, assemblerCommand) )
- assemblerProcess = Popen(assemblerCommand, cwd=globalParameters["WorkingPath"] )
+ assemblerProcess = Popen(assemblerCommand, \
+ cwd=globalParameters["WorkingPath"] )
assemblerProcess.communicate()
if assemblerProcess.returncode:
- printExit("Assembler process returned with code %u" % assemblerProcess.returncode)
+ printExit("Assembler process returned with code %u" \
+ % assemblerProcess.returncode)
# read code object file
fileString = ""
