{"action":"closed","issue":{"url":"https://api.github.com/repos/mshabunin/test/issues/545","labels_url":"https://api.github.com/repos/mshabunin/test/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/mshabunin/test/issues/545/comments","events_url":"https://api.github.com/repos/mshabunin/test/issues/545/events","html_url":"https://github.com/mshabunin/test/issues/545","id":91234079,"number":545,"title":"gpu::buildWarpPerspectiveMaps is not thread safe","user":{"login":"mshabunin","id":3304494,"avatar_url":"https://avatars.githubusercontent.com/u/3304494?v=3","gravatar_id":"","url":"https://api.github.com/users/mshabunin","html_url":"https://github.com/mshabunin","followers_url":"https://api.github.com/users/mshabunin/followers","following_url":"https://api.github.com/users/mshabunin/following{/other_user}","gists_url":"https://api.github.com/users/mshabunin/gists{/gist_id}","starred_url":"https://api.github.com/users/mshabunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshabunin/subscriptions","organizations_url":"https://api.github.com/users/mshabunin/orgs","repos_url":"https://api.github.com/users/mshabunin/repos","events_url":"https://api.github.com/users/mshabunin/events{/privacy}","received_events_url":"https://api.github.com/users/mshabunin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mshabunin/test/labels/Affected-2.4.0%20-%202.4.6","name":"Affected-2.4.0 - 2.4.6","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test/labels/auto-transferred","name":"auto-transferred","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test/labels/Category-gpu%20(cuda)","name":"Category-gpu (cuda)","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test/labels/Priority-Normal","name":"Priority-Normal","color":"bfe5bf"},{"url":"https://api.github.com/repos/mshabunin/test/labels/Status-Open","name":"Status-Open","color":"ededed"},{"url":"https://api.github.com/repos/mshabunin/test/labels/Target--","name":"Target--","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-26T12:05:20Z","updated_at":"2015-06-26T13:22:34Z","closed_at":"2015-06-26T13:22:34Z","body":"Converted from http://code.opencv.org/issues/3419\r\n```\n|| by Todd Pepper on 2013-12-04 04:38:00\n|| Status: Open\n|| Priority: Normal\n|| Affected: 2.4.0 - 2.4.6\n|| Target: -\n|| Category: gpu (cuda)\n\ngpu::buildWarpPerspectiveMaps is not thread safe\n===========\nIt looks like gpu::buildWarpPerspectiveMaps is not thread safe due to\nthe use of the float array c_warpMat below. I first noticed this when\ndebugging an issue in porting my tile warping application from CPU to\nGPU. The gpu::warpPerspective and gpu::buildWarpPerspectiveMaps calls\nrequire mutex locking in order to work properly in a multithreaded\napplication. It looks like this locking is only required due to the use\nof the c_warpMat. This will also affect the Affine transforms.\n\n\n    namespace cv { namespace gpu { namespace device\n    {\n        namespace imgproc\n        {\n            __constant__ float c_warpMat[3 * 3];\n\n            struct AffineTransform\n            {\n                static __device__ __forceinline__ float2 calcCoord(int x, int y)\n                {\n                    const float xcoo = c_warpMat[0] * x + c_warpMat[1] * y + c_warpMat[2];\n                    const float ycoo = c_warpMat[3] * x + c_warpMat[4] * y + c_warpMat[5];\n\n                    return make_float2(xcoo, ycoo);\n                }\n            };\n\n\n\nHistory\n=======\n|| by Nikita Manovich on 2013-12-11 11:56:00\n-   Status changed from New to Open\n```"}}