Reputation: 1904
I am debugging a segmentation fault related to OpenCL. Using gdb I noticed that several threads are created as a result of clCreateContext
GDB output:
print Before clCreateContext
[New Thread 0x7ffff299b700 (LWP 10807)]
[New Thread 0x7ffff219a700 (LWP 10808)]
[New Thread 0x7ffff1999700 (LWP 10809)]
[New Thread 0x7ffff1198700 (LWP 10810)]
[New Thread 0x7ffff0997700 (LWP 10811)]
[New Thread 0x7fffebfff700 (LWP 10812)]
[New Thread 0x7fffeb7fe700 (LWP 10813)]
print After clCreateContext
Does somebody have a clue what is the reason for that ?
[I am using OpenCl 1.2 with NVIDIA GPU on Ubuntu]
Upvotes: 1
Views: 168
Reputation: 795
OpenCL implementations need to spawn threads internally to support different features, such as monitoring device kernel execution or memory transfers, or to execute the user callbacks. This behaviour is implementation defined, so different implementations may spawn different number of threads.
Upvotes: 3