cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

mikewolf_gkd
Journeyman III

app hang when use printf in kernel

    I wrote a simple opencl program, but when I use printf debug kernel code, app hang, but comment on printf code, app get correct result.

my os: win7, amd app sdk 2.7, my display card: redwood.

    I rember before, not this issue in sdk 2.3, bug?

who can help me test it?

source code in :http://files.cnblogs.com/mikewolf2002/gclTutorial4.zip

http://images.cnblogs.com/cnblogs_com/mikewolf2002/201209/201209071947275287.png

0 Likes
11 Replies
binying
Challenger

Re: app hang when use printf in kernel

trying...

0 Likes
binying
Challenger

Re: app hang when use printf in kernel

1>  main.cpp

1>main.cpp(31): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

1>main.cpp(35): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

1>  gclTimer.cpp

1>  gclFile.cpp

1>gclFile.cpp(14): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

1>          c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen'

1>gclFile.cpp(31): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

1>          c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen'

1>  Generating Code...

1>RC : fatal error RC1110: could not open debug\gclTutorial4_manifest.rc

1> 

1>

1>Build FAILED.

1>

1>Time Elapsed 00:00:03.03

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

0 Likes
binying
Challenger

Re: app hang when use printf in kernel

Note that you didn't include a solution file in the source code...

0 Likes
mikewolf_gkd
Journeyman III

Re: app hang when use printf in kernel

you can build a solution or project for it, or you can give me your mail, I will send solution to you .

thanks

0 Likes
mikewolf_gkd
Journeyman III

Re: app hang when use printf in kernel

you can build a empty windows console solution, add all head file and cpp file to it

0 Likes
binying
Challenger

Re: app hang when use printf in kernel

That's what I did. Would you mind upload it again? So that everybody else can try it too. 

0 Likes
mikewolf_gkd
Journeyman III

Re: app hang when use printf in kernel

hi,there is a solution, including all projects, hang issue is in project 4

0 Likes
binying
Challenger

Re: app hang when use printf in kernel

I downloaded the zip file. Deleted the projects other than gclTutorial4. Since it fails compilation, I added the additioninclude/library path in order to use the opencl head file. I still get the following error. I am using A6, win7, vs2010, sdk 2.7 and the latest driver.

--------------------------

1>------ Rebuild All started: Project: gclTutorial4, Configuration: Debug Win32 ------

1>Build started 9/11/2012 3:26:41 AM.

1>_PrepareForClean:

1>  Deleting file "Debug\gclTutorial4.lastbuildstate".

1>InitializeBuildStatus:

1>  Touching "Debug\gclTutorial4.unsuccessfulbuild".

1>ClCompile:

1>  main.cpp

1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\main.cpp(31): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\main.cpp(35): warning C4244: '=' : conversion from 'int' to 'float', possible loss of data

1>  gclTimer.cpp

1>  gclFile.cpp

1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\gclfile.cpp(14): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

1>c:\users\tan_mcw\downloads\gcltutorial\gcltutorial\gcltutorial4\gclfile.cpp(31): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen'

1>  Generating Code...

1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

1>

1>Build FAILED.

1>

1>Time Elapsed 00:00:03.73

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

0 Likes
mikewolf_gkd
Journeyman III

Re: app hang when use printf in kernel

could you run other opencl program? such as app sdk samples, ...

I have placed "#pragram opencl.lib" in main.cpp, so you only need to add lib directory in vs2010.

0 Likes