{"action":"created","issue":{"url":"https://api.github.com/repos/alicevision/AliceVision/issues/420","repository_url":"https://api.github.com/repos/alicevision/AliceVision","labels_url":"https://api.github.com/repos/alicevision/AliceVision/issues/420/labels{/name}","comments_url":"https://api.github.com/repos/alicevision/AliceVision/issues/420/comments","events_url":"https://api.github.com/repos/alicevision/AliceVision/issues/420/events","html_url":"https://github.com/alicevision/AliceVision/pull/420","id":334542625,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NDg5MDQ1","number":420,"title":"Dev remove cuda tex refs","user":{"login":"griwodz","id":2108546,"node_id":"MDQ6VXNlcjIxMDg1NDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2108546?v=4","gravatar_id":"","url":"https://api.github.com/users/griwodz","html_url":"https://github.com/griwodz","followers_url":"https://api.github.com/users/griwodz/followers","following_url":"https://api.github.com/users/griwodz/following{/other_user}","gists_url":"https://api.github.com/users/griwodz/gists{/gist_id}","starred_url":"https://api.github.com/users/griwodz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griwodz/subscriptions","organizations_url":"https://api.github.com/users/griwodz/orgs","repos_url":"https://api.github.com/users/griwodz/repos","events_url":"https://api.github.com/users/griwodz/events{/privacy}","received_events_url":"https://api.github.com/users/griwodz/received_events","type":"User","site_admin":false},"labels":[{"id":315911354,"node_id":"MDU6TGFiZWwzMTU5MTEzNTQ=","url":"https://api.github.com/repos/alicevision/AliceVision/labels/review","name":"review","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-21T15:21:08Z","updated_at":"2018-06-22T13:22:48Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/alicevision/AliceVision/pulls/420","html_url":"https://github.com/alicevision/AliceVision/pull/420","diff_url":"https://github.com/alicevision/AliceVision/pull/420.diff","patch_url":"https://github.com/alicevision/AliceVision/pull/420.patch"},"body":"<!-- Checklist before submission:\r\n\r\n - I have read the [contribution guidelines](../CONTRIBUTING.md).\r\n - I have updated the documentation, if applicable.\r\n - I have ensured that the change is tested somewhere.\r\n - I have followed the prevailing code style (for history readability and limit conflicts for maintainance).\r\n\r\n-->\r\n## Description\r\n\r\nCUDA texture references have been removed and replaced with texture objects. Instead of binding texture to memory before a kernel call and unbinding it after, the textures are now created at memory allocation time and destroyed at memory release.\r\n\r\nThe maintenance of textured CUDA memory is still global, but collected in a single object named \"global_data\". Untextured memory has not been touched.\r\n\r\nChanges affect only depthMap/cuda. Prerequisite for understanding the side effects of slow kernels like refine_compUpdateYKNCCSimMapPatch_kernel .\r\n\r\n## Features list\r\n\r\n<!--\r\n- [ ] Feature one. Fix #XXX\r\n- [ ] Improve something else\r\n- [ ] Connect to #3 (to declare link to issues without closing it when the PR is merged).\r\n- [X] Add \"X\" when it is done.\r\n-->\r\n\r\n\r\n## Implementation remarks\r\n\r\nThe changes remove global CUDA texture references, which are a limited resource and require on-demand binding to and unbinding from CUDA memory. An unlimited number of CUDA texture objects can be allocated. Using texture objects has some advantages:\r\n - slightly faster because bind/unbind is removed\r\n - texture objects are passed as parameters to CUDA kernels, which makes dependencies explicitly visible throughout the call chain\r\n - a piece of memory can be allocated with a texture object, keeping it throughout the memory's lifetime\r\n\r\nCUDA memory is frequently allocated like local variables and deallocated at function exit. For memory with textures, this wasteful behavior is now avoided. Memory is now drawn from a pool in global_data, and pushed back when is not needed any more. For low end GPUs, a compile flag or explicit release may be desirable to keep the old semantics.\r\n\r\nA surprising amount of dead code was removed in the process.\r\n\r\n<!--\r\nExplain main implementation choices.\r\nIt is also the right place to ask for feedback and help when you hesitate on the implementation.\r\n-->\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alicevision/AliceVision/issues/comments/399440654","html_url":"https://github.com/alicevision/AliceVision/pull/420#issuecomment-399440654","issue_url":"https://api.github.com/repos/alicevision/AliceVision/issues/420","id":399440654,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTQ0MDY1NA==","user":{"login":"fabiencastan","id":153585,"node_id":"MDQ6VXNlcjE1MzU4NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/153585?v=4","gravatar_id":"","url":"https://api.github.com/users/fabiencastan","html_url":"https://github.com/fabiencastan","followers_url":"https://api.github.com/users/fabiencastan/followers","following_url":"https://api.github.com/users/fabiencastan/following{/other_user}","gists_url":"https://api.github.com/users/fabiencastan/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiencastan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiencastan/subscriptions","organizations_url":"https://api.github.com/users/fabiencastan/orgs","repos_url":"https://api.github.com/users/fabiencastan/repos","events_url":"https://api.github.com/users/fabiencastan/events{/privacy}","received_events_url":"https://api.github.com/users/fabiencastan/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T13:22:48Z","updated_at":"2018-06-22T13:22:48Z","author_association":"MEMBER","body":"Yes, sometimes codacy detects false positives..."}}
{"actor":{"display_login":"fabiencastan"}}