cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

evk8888
Journeyman III

OpenCL Thread Creation!

Number of threads created when a opencl program is run?

Hello,

I have a basic matrix multiplication opencl code and when i run the code with gdb, i see that there is thread creation equal to the number of processing elements in the system 

[New Thread 0x7ffff2c5e710 (LWP 23553)]

[New Thread 0x7ffff285d710 (LWP 23554)]

also if i set the max compute units variable to any number, the number of threads created is always the same (=processing elements). Is there any explanation for this and is there a way to control this creation of threads?? thanks in advance.
evk


0 Likes
5 Replies
genaganna
Journeyman III

Originally posted by: evk8888 Hello,

I have a basic matrix multiplication opencl code and when i run the code with gdb, i see that there is thread creation equal to the number of processing elements in the system 

[New Thread 0x7ffff2c5e710 (LWP 23553)]

[New Thread 0x7ffff285d710 (LWP 23554)]

also if i set the max compute units variable to any number, the number of threads created is always the same (=processing elements). Is there any explanation for this and is there a way to control this creation of threads?? thanks in advance.
evk

Are you talking about CPU_MAX_COMPUTE_UNITS environmental variable?

0 Likes

Nope. I am talking about the thread creation done by opencl library when the code is run. this can be seen when we use GDB to run a executable.  There are new thread created equal to the number of compute units. This does not change even when the cpu max compute units env variable is changed.. its always equal to the max units available in the system. I hope now its a bit clear...

 

evk.

0 Likes

Hello guys... anyone has some insight into this aspect of the api let me know.. thanks

0 Likes

Well it would help if you answered the questions consistently.

q: "are you talking about CPU_MAX_COMPUTE_UNITS variable"

a: nope

later ... "This does not change even when the cpu max compute units env variable is changed..."

So which is it?

I know CPU_MAX_COMPUTE_UNITS works, but I don't know whether threads are created beyond it as i'm not using c.  I just debug using printf.

 

0 Likes

Thanks. I agree with u about answering.. will try to do it often...

You have understood my question..cool. i hope somebody has some answer to this....

 

Thanks

0 Likes