Reputation: 53
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 Project) to be loaded and used by CLR Form applications. The DLL is importing the openCL static library c++ header files (native code) and using a managed wrapper class to use to expose it to the CLR.
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(1270): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
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)
1>To work around this problem, try simplifying or changing the program near the locations listed above.
1>Please choose the Technical Support command on the Visual C++
Which points to
cl_int enqueueNativeKernel(
void (CL_CALLBACK *userFptr)(void *),
I am using amd APP SDK v2.6 with the openCL 1.2 specs,Visual Studio 2010 Ultimate and linking the header/lib provided by the SDK. 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,and a Compiler Crash(CL.exe because of c1xx.dll) and no matter how I play with the switches I am at a loss.
Switches are as follows /CLR, /MDd, Optimisation Disabled, EHa for Exception handling. And removing #defines or any of the wrapping code does't change a thing nor removing the #pragmas.
I should note that the project compiles fine with the C API included instead (CL\cl.h) and I know I could use that instead.
Has anyone else encountered this issue? Or am I doing something terribly wrong?I would really appreciate some info on the matter.
Upvotes: 3
Views: 2344
Reputation: 473174
An internal compiler error means that your compiler has crashed. It didn't find an error in your code; the compiler itself broke. This is due to a bug in the compiler, but if your code is wrong, then that could have helped trigger the bug.
Since "your code" in this case is not really your code, but OpenCL's code, it may just be that it can't be compiled by the C++/CLI compiler.
Upvotes: 2