{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/tvm/issues/923","repository_url":"https://api.github.com/repos/dmlc/tvm","labels_url":"https://api.github.com/repos/dmlc/tvm/issues/923/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/tvm/issues/923/comments","events_url":"https://api.github.com/repos/dmlc/tvm/issues/923/events","html_url":"https://github.com/dmlc/tvm/issues/923","id":299459165,"number":923,"title":"[RFC] Target and Generic Function System on C++","user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars3.githubusercontent.com/u/2577440?v=4","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"labels":[{"id":540459689,"url":"https://api.github.com/repos/dmlc/tvm/labels/rfc","name":"rfc","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-02-22T18:27:21Z","updated_at":"2018-02-26T19:19:59Z","closed_at":null,"author_association":"OWNER","body":"Use this issue to discuss design choices we can make for target and generic function system. Most of the current discussion are implemented in https://github.com/dmlc/tvm/pull/892 thanks to @alex-weaver \r\n\r\nSince target system is quite useful, we want to take some deliberation on this and use this issue for discussing potential API.\r\n\r\n- Generic function itself behaves like PackedFunc, except it dispatches on current target scope.\r\n- We need to support a target scoping stack via TLS\r\n\r\nWe can have RAII style version of scoping. Like\r\n```\r\ntvm::TargetContext ctx(target);\r\n```\r\n\r\nWhich set target at construction time, and call Exit at destructor\r\nInstead of using setter getter, the target can be supported via scoping backed by a stack in TLS, which looks like ```Target::EnterTargetScope(target); Target::ExitTargetScope()```.\r\n\r\nWe can have RAII style version of scoping. Like\r\n```\r\ntvm::TargetContext ctx(target);\r\n```\r\n\r\nWhich set target at construction time, and call Exit at destructor."},"comment":{"url":"https://api.github.com/repos/dmlc/tvm/issues/comments/368617110","html_url":"https://github.com/dmlc/tvm/issues/923#issuecomment-368617110","issue_url":"https://api.github.com/repos/dmlc/tvm/issues/923","id":368617110,"user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars3.githubusercontent.com/u/2577440?v=4","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T19:19:59Z","updated_at":"2018-02-26T19:19:59Z","author_association":"OWNER","body":"yes, we can still have a string key based registry for generic func"}}
{"actor":{"display_login":"tqchen"}}