Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Polar01
Beginner
40 Views

Compare assembly ?

Hi,
I have a kernel that crash in some situations, what I got is a "dissassembly" from Visual Studio 2008. Something like this :
77A204F8 jmp 779E8747
77A204FD and dword ptr [ebp-31Ch],0
77A20504 lea eax,[ebp-32Ch]
77A2050A push eax
77A2050B mov dword ptr [ebp-32Ch],0C0000029h
77A20515 mov dword ptr [ebp-328h],edi
77A2051B mov dword ptr [ebp-324h],esi
77A20521 call 779E8B68
77A20526 jmp 779E8ACF
77A2052B dec eax
77A2052C dec eax
77A2052D je 77A2055D
77A2052F and dword ptr [ebp-31Ch],0
77A20536 lea eax,[ebp-32Ch]
77A2053C push eax
77A2053D mov dword ptr [ebp-32Ch],0C0000026h
The problem is that I have no tool to find which intruction in my OpenCL kernel is related to this code ?
Does the Intel Offline compiler can help ?
Thanks
0 Kudos
6 Replies
Doron_S_Intel
Employee
40 Views

There are several ways to go about it:
You can use the offline compiler and/or Intel VTune Amplifier to try and correspond OpenCL code to assembly. To ease the task, you can add write of "marker" constants such as 0x123456 to a dummy buffer, these cannot be optimized away and will help you segment your code if the offline compiler's annotations aren't enough.
Moreover, you could configure your debugger to catch access violation errors before try{} blocks get a chance to see them - for Microsoft Visual studio, this is under Debug->Exceptions->Win32 Exceptions. Then you can run in debug mode and get a notification as soon as the offending instruction occurs.

Doron Singer
Polar01
Beginner
40 Views

Thanks a lot,

VTune amplifier sounds great but is too expensive for me :-(

About the dummy buffer, I can try... it is a strange and hard way to debug :-P

I also have set the 'access violation' exception in VS2008, it catch it and show me some dissassembly. But this dissassembly does not correspond to what I see in the Offline compiler !

Polar01
Beginner
40 Views

I have found something, it is not my problem but ... (At least I still have a crash)

I have a method like this :

float sample(Seed* seed) { ... }

and a call to this method :

__global clTask* task = ... ;
float b = sample( &task->seed );

The compiler say nothing, no error ! You see here that 'task' is a global pointer, so 'seed' is global too !
Polar01
Beginner
40 Views

Hi,

I have try to put a marker in the code, no success :-(

So, I have download the trial of VTune, it sounds to be a great product for optimization but it does not support OpenCL ! Also, I have not find any way to dissassemble some code to optimize too !

Are you sure that it is VTune ? If yes, how can I do please ?

Thanks
Doron_S_Intel
Employee
40 Views

Please read the user guide for information about integration with Intel VTune Amplifier and other tools.
Polar01
Beginner
40 Views

Thanks Doron,
It will be fine if the Offline compiler can be improved. Because we have no correspondance between the OpenCL code and the assembly code (LLVM code too).
Also, a CPU debugging tools for OpenCL kernel will be welcome :-)
Thanks
Krys