{"action":"created","issue":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1161","labels_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1161/labels{/name}","comments_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1161/comments","events_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1161/events","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/issues/1161","id":109458657,"number":1161,"title":"Placeholder: __constant__ in a host function","user":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/labels/libPMacc","name":"libPMacc","color":"fbca04"},{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/labels/warning","name":"warning","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"psychocoderHPC","id":4037125,"avatar_url":"https://avatars.githubusercontent.com/u/4037125?v=3","gravatar_id":"","url":"https://api.github.com/users/psychocoderHPC","html_url":"https://github.com/psychocoderHPC","followers_url":"https://api.github.com/users/psychocoderHPC/followers","following_url":"https://api.github.com/users/psychocoderHPC/following{/other_user}","gists_url":"https://api.github.com/users/psychocoderHPC/gists{/gist_id}","starred_url":"https://api.github.com/users/psychocoderHPC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychocoderHPC/subscriptions","organizations_url":"https://api.github.com/users/psychocoderHPC/orgs","repos_url":"https://api.github.com/users/psychocoderHPC/repos","events_url":"https://api.github.com/users/psychocoderHPC/events{/privacy}","received_events_url":"https://api.github.com/users/psychocoderHPC/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/milestones/2","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/milestones/Open%20Beta","labels_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/milestones/2/labels","id":395839,"number":2,"title":"Open Beta","description":"Tasks to complete until the release of our open beta (version 0.1)\r\n\r\nThe [beta](https://en.wikipedia.org/wiki/Software_release_life_cycle#Beta) release shall be useful for *physicist* that used a Particle-in-Cell code *before*. Experience with *compiling libraries from source* and a *good Linux knowledge* is required for the initial installation.\r\n","creator":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"open_issues":130,"closed_issues":935,"state":"open","created_at":"2013-08-06T16:38:57Z","updated_at":"2015-10-02T09:23:32Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-10-02T09:23:32Z","updated_at":"2015-10-02T11:12:22Z","closed_at":null,"body":"Follow-up to #1152:\r\n\r\nPutting `#include <thrust/sort.h>` in the first line of `main.cu` (I know, should be included after `<mpi.h>` ideally) throws the following warnings which might indicate an implementation problem with placeholders:\r\n\r\n```\r\nsrc/picongpu/include/plugins/kernel/CopySpecies.kernel(106): warning:\r\n  a __constant__ variable \"PMacc::device_placeholder13::multiMask_\" cannot be directly read in a host function\r\n\r\nsrc/libPMacc/include/particles/particleFilter/PositionFilter.hpp(79): warning:\r\n  a __constant__ variable \"PMacc::device_placeholder12::localCellIdx_\" cannot be directly read in a host function\r\n\r\nsrc/picongpu/include/plugins/kernel/CopySpecies.kernel(126): warning:\r\n  a __constant__ variable \"PMacc::device_placeholder12::localCellIdx_\" cannot be directly read in a host function\r\n\r\nsrc/picongpu/include/plugins/kernel/CopySpecies.kernel(127): warning:\r\n  a __constant__ variable \"picongpu::device_placeholder17::globalCellIdx_\" cannot be directly read in a host function\r\n\r\nsrc/picongpu/include/plugins/kernel/CopySpecies.kernel(106): warning:\r\n  a __constant__ variable \"PMacc::device_placeholder13::multiMask_\" cannot be directly read in a host function\r\n\r\nsrc/libPMacc/include/particles/particleFilter/PositionFilter.hpp(79): warning:\r\n  a __constant__ variable \"PMacc::device_placeholder12::localCellIdx_\" cannot be directly read in a host function\r\n\r\nsrc/picongpu/include/plugins/kernel/CopySpecies.kernel(126): warning:\r\n  a __constant__ variable \"PMacc::device_placeholder12::localCellIdx_\" cannot be directly read in a host function\r\n\r\nsrc/picongpu/include/plugins/kernel/CopySpecies.kernel(127): warning:\r\n  a __constant__ variable \"picongpu::device_placeholder17::globalCellIdx_\" cannot be directly read in a host function\r\n```\r\n\r\n(tested on the default/Empty example)."},"comment":{"url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/comments/144992365","html_url":"https://github.com/ComputationalRadiationPhysics/picongpu/issues/1161#issuecomment-144992365","issue_url":"https://api.github.com/repos/ComputationalRadiationPhysics/picongpu/issues/1161","id":144992365,"user":{"login":"Flamefire","id":309017,"avatar_url":"https://avatars.githubusercontent.com/u/309017?v=3","gravatar_id":"","url":"https://api.github.com/users/Flamefire","html_url":"https://github.com/Flamefire","followers_url":"https://api.github.com/users/Flamefire/followers","following_url":"https://api.github.com/users/Flamefire/following{/other_user}","gists_url":"https://api.github.com/users/Flamefire/gists{/gist_id}","starred_url":"https://api.github.com/users/Flamefire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Flamefire/subscriptions","organizations_url":"https://api.github.com/users/Flamefire/orgs","repos_url":"https://api.github.com/users/Flamefire/repos","events_url":"https://api.github.com/users/Flamefire/events{/privacy}","received_events_url":"https://api.github.com/users/Flamefire/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T11:12:22Z","updated_at":"2015-10-02T11:12:22Z","body":"I looked into the code and found the following in the definition of the `identifier`macro:\r\n\r\n    #ifdef __CUDA_ARCH__ //we are on gpu\r\n    #define PMACC_PLACEHOLDER(id) using namespace PMACC_JOIN(device_placeholder,id)\r\n    #else\r\n    #define PMACC_PLACEHOLDER(id) using namespace PMACC_JOIN(host_placeholder,id)\r\n    #endif\r\n\r\nSo depending on whether the code is beeing compiled for GPU or CPU either the `__constant__`-annotated instance or the \"normal\" instance is used.\r\n\r\nI therefore suspect thrust to define `__CUDA_ARCH__` somewhere so this check fails."}}