Is it possible to offline compile kernels using amd SDK for checking the assembly generated on Linux? (similarly to Intel's offline compiler?)
I know you're asking about Linux, but if you run a windows virtual machine you can still use the AMD APP KernelAnalyzer. Check out this thread for a possible issue and solution to using it in a virtual machine: KernelAnalyzer 11.11 on System without AMD GPU.
Otherwise, for now you have to code it yourself using information found in KB115.
That is a helpful suggestion. But for the binary method, I already tried it. It creates a file which objdump does not recognize... I opened it with text editor and it starts with "CLPC^A^@^@...." normal ELF binaries have ELF in the beginning eh? am I doing something wrong? maybe suggestion from 2.3 sdk does not apply to 2.6 sdk?
About running windows, it is too much work for getting a simple assembly output. Because I want to check for AVX instructions and I run the code in a remote machine.
run examples with "--dump filename" option. it output binary kernels. it ouputs ELF files so you must do some error.
You are right, I was doing something wrong. I was running the programs with Intel SDK. Now I can get the ELF stuff
But there is a new problem, I am not able to use objdump on the program, how do I see the assembly code? (below is an example from sdk directly, just making sure that it is not my binary which has the fault)
/opt/AMDAPP/samples/opencl/bin/x86_64/BinarySearch --device cpu --dump file
...
Intel(R) Xeon(R) CPU | E5430 @ 2.66GHz binary kernel: file.13 |
...
readelf -aW file.13
...
Machine: | <unknown>: 0x7d2 |
...
objdump -d file.13
file.13: | file format elf64-little |
objdump: can't disassemble for architecture UNKNOWN!
...
objcopy -I elf64-x86-64 -O elf64-x86-64 -R .source -R .llvmir -R .amdil --alt-machine-code=0x7d2 file.13 stripped_file.13.bin
objcopy: this target does not support 2002 alternative machine codes
objcopy: treating that number as an absolute e_machine value instead
...
objdump -d stripped_file.13.bin
stripped_file.13.bin: file format elf64-little
objdump: can't disassemble for architecture UNKNOWN!
try objdump -m i386:x86-64 -d file.13
PS. yes I found that out too... but forgot to click send as it appears...
Ouch, nevermind!
objdump -dm i386:x86-64 file.13
seems to work...
But one more question, how can I get the program to create instructions for a CPU which has AVX support on a CPU which doesnt have it?