The detectMultiScale function is stuck and cannot continue execution

I want to use CUDA for face detection, but when executing the faceCascade->detectMultiScale function, it always gets stuck there and doesn’t proceed further, and it consumes a lot of CPU. Why is it not utilizing the GPU?
excuse me, Can someone help me with this?