Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Journeyman III

C++/CLI with OpenCL and VS 10

First for all I would like to start by saying I am relatively new to openCL and kinda rusty in C++. Also this is the first time  I'm asking a question so feel free to correct me or point to something I could improve in the post.

I am interested in creating a project that will create mixed mode assembly dll (CLR Library aka DLL) to be loaded and used by CLR Form applications. However I keep falling into the pitfall of fatal error C1001 which really isn't much to go through.

1>C:\Program Files (x86)\AMD APP\include\cl\cl.hpp(3708): fatal error C1001: An internal error has occurred in the compiler.

1>  (compiler file 'msc1.cpp', line 1420) which in this case points to     cl_int enqueueNativeKernel( void (CL_CALLBACK *userFptr)(void *), line of the hpp.

I am using amd APP SDK v2.6 with Visual Studio 2010 Ultimate and linking the header/lib provided for c++. In theory the crossing from unmanaged to unmanaged code shouldn't be an issue buut since it's compiled with CLR I included the #pragmas to indicate the unmanaged passing anyway


#pragma once

#pragma managed(push,off)

#define __NO_STD_STRING

#define __NO_STD_VECTOR

#include <cl\cl.hpp>

#pragma comment(lib,"OpenCL.lib")

#pragma managed(pop)

//rest of code

Always with the dreadful C1001 error,after the Compiler Crashes(CL.exe)  and no matter how I play with the switches I am at a loss.

Additionaly, #define __CL_ENABLE_EXCEPTIONS throws a C4290 warning. Removing the __NO_STD didn't really make a difference.

I should note that the project compiles fine with the C API included instead of the hpp and I know I could use that instead.

Has anyone else encountered this issue? I would really appreciate some info on the matter.

1 Reply
Journeyman III

Did you search the error on Microsoft's site? It is their compiler error, not OpenCL's nor AMD's.

I did the same thing we are doing, and it worked fine,.