Fransebas
Fransebas

Reputation: 341

What can cause CL_INVALID_CONTEXT (-34) on clCreateBuffer?

I'm using a 2015 MacBook Pro and using the Iris Pro device and when I try to allocate 1024 int of memory using clCreateBuffer clCreateBuffer(context, flags, v.size() * sizeof(int), NULL, &error) I get error CL_INVALID_CONTEXT (-34) but the context didn't return error and I even created a command queue with it. Any idea?.

Upvotes: 1

Views: 558

Answers (1)

Fransebas
Fransebas

Reputation: 341

I found the answer, I was releasing the context clReleaseContext before clCreateBuffer. That happened because I'm using clases and in the destructor I put the clReleaseContext and I didn't realize the destructor was getting called.

Upvotes: 1

Related Questions