boostorg / compute

A C++ GPU Computing Library for OpenCL
http://boostorg.github.io/compute/
Boost Software License 1.0
1.52k stars 333 forks source link

how to fill array of custom user structures ? #857

Open itmanager85 opened 3 years ago

itmanager85 commented 3 years ago

for example needs something that,

` struct Box { float3 v0; float3 v1;

    Box() {
        v0 = float3(M_INF, M_INF, M_INF);
        v1 = float3(-M_INF, -M_INF, -M_INF);
    }

}; __declspec(align(16)) struct Node { int index; int offset; Box box;

    Node() {
        index = -1;
    }

};

boost::compute::vector<Node> nodes(10, context);

Node node_default;

boost::compute::fill(nodes.begin(), nodes.end(), node_default, // compile error with that queue); `

how to fill array "nodes" with value "node_default" ?