{"action":"created","issue":{"url":"https://api.github.com/repos/arrayfire/arrayfire/issues/1635","repository_url":"https://api.github.com/repos/arrayfire/arrayfire","labels_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/1635/labels{/name}","comments_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/1635/comments","events_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/1635/events","html_url":"https://github.com/arrayfire/arrayfire/issues/1635","id":185243779,"number":1635,"title":"freeing allocated host memory gives error message","user":{"login":"AEHousman","id":13970584,"avatar_url":"https://avatars.githubusercontent.com/u/13970584?v=3","gravatar_id":"","url":"https://api.github.com/users/AEHousman","html_url":"https://github.com/AEHousman","followers_url":"https://api.github.com/users/AEHousman/followers","following_url":"https://api.github.com/users/AEHousman/following{/other_user}","gists_url":"https://api.github.com/users/AEHousman/gists{/gist_id}","starred_url":"https://api.github.com/users/AEHousman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AEHousman/subscriptions","organizations_url":"https://api.github.com/users/AEHousman/orgs","repos_url":"https://api.github.com/users/AEHousman/repos","events_url":"https://api.github.com/users/AEHousman/events{/privacy}","received_events_url":"https://api.github.com/users/AEHousman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-25T21:51:13Z","updated_at":"2016-10-25T22:55:53Z","closed_at":null,"body":"the code is very vanilla:\r\n\r\n```\r\n#include <arrayfire.h>\r\nvoid main()\r\n{\r\n\t\taf::setDevice(0);\r\n\t\taf::info();\r\n\r\n\t\tarray baz = constant(0, 512, 512);\r\n\t\tfloat *foo = baz.host<float>();\r\n\t\taf::free(foo);   // fails here\r\n}\r\n```\r\n\r\nThe text of the error message (when I put in the exception handler) is:\r\n\r\nArrayFire v3.4.1 (Cuda, 64-bit Windows, build b9055b1)\r\nPlatform: CUDA Toolkit 8, Driver: CUDA Driver Version: 8000\r\n[0] GeForce GTX 970, 4096 MB, CUDA Compute 5.2\r\nArrayFire Exception (Internal error:998):\r\nIn function void __cdecl cuda::MemoryManager::nativeFree(void *)\r\nIn file src\\backend\\cuda\\memory.cpp:105\r\nCUDA Error (17): invalid device pointer\r\n\r\nIn function void __cdecl af::free(const void *)\r\nIn file src\\apiu\\cpp\\device.cpp:139\r\n\r\n----------------------\r\nWhile I'm here, is there a simple way to copy the data in foo back to baz? I know I can create a new array from foo and its dimensions and type, but since I already have exactly the array I need in baz, is there a way I can reuse it easily?\r\n"},"comment":{"url":"https://api.github.com/repos/arrayfire/arrayfire/issues/comments/256202416","html_url":"https://github.com/arrayfire/arrayfire/issues/1635#issuecomment-256202416","issue_url":"https://api.github.com/repos/arrayfire/arrayfire/issues/1635","id":256202416,"user":{"login":"AEHousman","id":13970584,"avatar_url":"https://avatars.githubusercontent.com/u/13970584?v=3","gravatar_id":"","url":"https://api.github.com/users/AEHousman","html_url":"https://github.com/AEHousman","followers_url":"https://api.github.com/users/AEHousman/followers","following_url":"https://api.github.com/users/AEHousman/following{/other_user}","gists_url":"https://api.github.com/users/AEHousman/gists{/gist_id}","starred_url":"https://api.github.com/users/AEHousman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AEHousman/subscriptions","organizations_url":"https://api.github.com/users/AEHousman/orgs","repos_url":"https://api.github.com/users/AEHousman/repos","events_url":"https://api.github.com/users/AEHousman/events{/privacy}","received_events_url":"https://api.github.com/users/AEHousman/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T22:55:53Z","updated_at":"2016-10-25T22:55:53Z","body":"Thanks! Ugh, my bad for using a stack overflow answer for my original code http://stackoverflow.com/questions/29210097/retrieving-values-from-arrayfire-array-as-standard-types-and-serialization, see code in the answer."}}
{"actor":{"display_login":"AEHousman"}}