Commit 77320e00 authored by Kazutomo Yoshii's avatar Kazutomo Yoshii
Browse files

adding genasm-hack

parent 516df6a5
all: kernel.p9asm
kernel.p9asm: ../dummy.cl
./gen9disasm.sh ../dummy.cl
clean:
rm -rf dump
rm -f *_Gen9core.*
rm -f kernel.p9asm
#!/bin/bash
#
# A script to generate a Gen9 assembly code from specified
#
# Written by Kazutomo Yoshii <kazutomo@mcs.anl.gov>
#
DEV=skl
OUTPUT=kernel.p9asm
if [ -z "$1" ] ; then
echo $0 clsrc [device]
echo
echo default device: skl
echo
echo To specify the patch dir:
echo
echo OCLOCPATCH=IGC_PATCH_DIR ./gen9disasm.sh code.cl
exit 0
fi
#DRYMODE="echo dry:"
DRYMODE=
SRC=$1
BN=`basename $SRC`
NAME=${BN%.cl}
if [ ! -z "$2" ] ; then
DEV=$2
fi
$DRYMODE ocloc -file $SRC -device $DEV
OD=dump
echo "Creating the directory $OD"
$DRYMODE rm -rf $OD
$DRYMODE mkdir $OD
CMD="ocloc disasm -file ${NAME}_Gen9core.bin -dump $OD"
if [ ! -z $OCLOCPATCH ] ; then
CMD="$CMD -patch $OCLOCPATCH"
fi
$DRYMODE $CMD
$DRYMODE iga64 $OD/${NAME}_KernelHeap.bin -p 9 -d > $OUTPUT
echo
echo $OUTPUT is generate
echo
exit 0
# ocloc disasm -file dummy_Gen9core.bin \
# -dump dump \
# -patch /home/kazutomo/gitwork-mro/gen-workspace/igc/IGC/AdaptorOCL/ocl_igc_shared/executable_format
#!/bin/bash
#
# A script to generate a Gen9 OpenCL binary from a modified asm code with dump contents
#
# Written by Kazutomo Yoshii <kazutomo@mcs.anl.gov>
#
iga64 kernel.p9asm -p 9 -a > dump/dummy_KernelHeap.bin
ocloc asm -dump dump/ -out new.bin
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