added compilation script for ptx

This commit is contained in:
Evghenii
2014-01-06 16:54:19 +01:00
parent 4562304a29
commit f130bfd25c
2 changed files with 6 additions and 12 deletions

View File

@@ -1,12 +0,0 @@
export void saxpy(const uniform float a, const uniform float x_[], const uniform float y_[], uniform float z_[], const uniform int n)
{
foreach (i = 0 ... n)
{
const double x = x_[i];
const double y = y_[i];
const double dz = y + a*x;
const double dz1 = 1.0/sqrt(dz);
const float z = dz1;
z_[i] = rsqrt(z);
}
}

6
ptxtestcc.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
LLC=$HOME/usr/local/llvm/bin-trunk/bin/llc
ISPC=ispc
PTXCC=ptxcc
$(cat $1 |grep -v 'width'|$ISPC --target=nvptx --emit-llvm -o -|$LLC -march=nvptx64 -mcpu=sm_35 -o $1.ptx)
$($PTXCC $1.ptx -Xptxas=-v -o $1.ptx.o)