Skip to content

Convert thrust::host_vector<float3> to std::vector<std::vector<float>> #1042

Answered by miscco
drperpen asked this question in Thrust
Discussion options

You must be logged in to vote

I am not sure I understand the question though. Do you want to split the vector float3_vector into multiple smaller arrays, or do you want to just add it to backinblack?

If the you want the latter this should work:

    // Send the host_vector back to std::vector<std::vector<float>>
    std::vector<std::vector<float>> backinblack{std::vector<float>{float3_vector.begin(), float3_vector.end()}};

This creates a vector of vector via direct-list initialization of a single vector that in turn is created from the range [float3_vector.begin(), float3_vector.end())

Replies: 0 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@drperpen
Comment options

Answer selected by drperpen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Thrust
Labels
None yet
2 participants