CUDA with GUI on Visual Studio 2012, C++

Hello!
Tell me please.
As it is possible to create a CUDA-application with GUI (not the console) in the Visual Studio of 2012 on With ++.
On Windows form there shall be a Calculation button for calculation for CUDA technology.
The result needs to be removed in Label, TexBox, etc.

so… what’s the problem?

I create a CUDA-application: Create project->CUDA 8.0->I delete the kernel.cu code->I insert the code for computation of integral (I need to remove value of integral in “Label”). I click “To add a new Items”->UI->Windows Forms. Автоматически устанавливается CLR. SubSystem->Windows(/SUBSYSTEM:WINDOWS). Entry Point=“main”

I add a code of start of the form to the .cpp file:

#include “Myform.h”
using namespace System;
using namespace System::Windows:Forms
[STAThread]

void main (array <>String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Main_programm::MyForm form;
Application::Run(%form);
}

After compilation there are a lot of errors: error C2653; C2065; C2146; C2065; C2065
I have a question: how to connect the project and what to write in processing of “System:Void button1_Click(System::Object^ sender, System::EventArgs^ e) {…}” to launch a code-CUDA on execution

In settings of the project it is set: “Common Language Runtime Support (/clr)”

Excuse for bad English. Tried to write simply that all understood a problem essence

create ‘empty CLR project’, then add ‘new Windows form’ and main() as you shown above.
you will find empty window when run.

after that, see https://devtalk.nvidia.com/default/topic/990780/cuda-programming-and-performance/implement-cuda-in-a-standard-vc-project/
preparation for CUDA.

so,… add device_code.cu in your project, then call it in button1_Click(…) member-func.

I supporse you can NOT call device-kernel as:

my_kernel<<<grid,block>>>(arg)

take a look: https://devtalk.nvidia.com/default/topic/979462/how-can-i-compile-cuda-code-then-link-it-to-a-c-clr-project/

this shows an alternative of <<<…>>>

Many thanks !!
This helped me a lot.