{"action":"created","issue":{"url":"https://api.github.com/repos/hughperkins/cltorch/issues/13","labels_url":"https://api.github.com/repos/hughperkins/cltorch/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/hughperkins/cltorch/issues/13/comments","events_url":"https://api.github.com/repos/hughperkins/cltorch/issues/13/events","html_url":"https://github.com/hughperkins/cltorch/issues/13","id":95432322,"number":13,"title":"[Feature request] Realtime compiled kernels","user":{"login":"szagoruyko","id":4953728,"avatar_url":"https://avatars.githubusercontent.com/u/4953728?v=3","gravatar_id":"","url":"https://api.github.com/users/szagoruyko","html_url":"https://github.com/szagoruyko","followers_url":"https://api.github.com/users/szagoruyko/followers","following_url":"https://api.github.com/users/szagoruyko/following{/other_user}","gists_url":"https://api.github.com/users/szagoruyko/gists{/gist_id}","starred_url":"https://api.github.com/users/szagoruyko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szagoruyko/subscriptions","organizations_url":"https://api.github.com/users/szagoruyko/orgs","repos_url":"https://api.github.com/users/szagoruyko/repos","events_url":"https://api.github.com/users/szagoruyko/events{/privacy}","received_events_url":"https://api.github.com/users/szagoruyko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-16T13:24:58Z","updated_at":"2015-07-18T12:53:59Z","closed_at":"2015-07-18T07:16:04Z","body":"Following https://github.com/hughperkins/cltorch/issues/2.\r\nThe API has to be the similar to cutorch-rtc (example here https://github.com/szagoruyko/cutorch-rtc/blob/master/test.lua#L95) with may be different names for the functions (without PTX for example).\r\nSo there has to be two functions:\r\n```lua\r\nfunction cltorch.compile(string)\r\n```\r\ntaking the kernel code as the argument and storing the compiled code somewhere inside cltorch and\r\n```lua\r\nfunction cltorch.launch(kernel_name, arguments, global_work_offset, global_work_size, local_work_size)\r\n```\r\narguments in the form of a table (in cutorch-rtc I did it in ffi here https://github.com/szagoruyko/cutorch-rtc/blob/master/init.lua#L8). In this form only textures are out of the boat, still haven't thought how to add them to cutorch-rtc.\r\nlocal_work_size should be taken from max device properties if not specified. \r\nKernels should have just raw pointers as arguments, I wouldn't bother with strides, just enforce contiguity of input and output tensors.\r\nIs there a way to compile with CPU support btw?"},"comment":{"url":"https://api.github.com/repos/hughperkins/cltorch/issues/comments/122540890","html_url":"https://github.com/hughperkins/cltorch/issues/13#issuecomment-122540890","issue_url":"https://api.github.com/repos/hughperkins/cltorch/issues/13","id":122540890,"user":{"login":"szagoruyko","id":4953728,"avatar_url":"https://avatars.githubusercontent.com/u/4953728?v=3","gravatar_id":"","url":"https://api.github.com/users/szagoruyko","html_url":"https://github.com/szagoruyko","followers_url":"https://api.github.com/users/szagoruyko/followers","following_url":"https://api.github.com/users/szagoruyko/following{/other_user}","gists_url":"https://api.github.com/users/szagoruyko/gists{/gist_id}","starred_url":"https://api.github.com/users/szagoruyko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szagoruyko/subscriptions","organizations_url":"https://api.github.com/users/szagoruyko/orgs","repos_url":"https://api.github.com/users/szagoruyko/repos","events_url":"https://api.github.com/users/szagoruyko/events{/privacy}","received_events_url":"https://api.github.com/users/szagoruyko/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T12:53:59Z","updated_at":"2015-07-18T12:53:59Z","body":"Thanks for the clarification Hugh. Still I don't see places were I could apply your current implementation in my projects.\r\nIs there at least a way to expose clContext, clDevice and clBuffers pointers to lua?\r\nI could implement this myself sometime in the future when I need it, right now I've got many things that need to be implemented in CUDA first."}}