5

I was wondering just how realistic is it to process strings, rather than numerics, on the GPU? Specifically, what I'm interested in is using C++ AMP to perform comparisons between an array of strings and a target string.

I've started with basics such as passing a wchar_t* strings[] into a function, but it turns out that you cannot even create a view with a type smaller than an int!

So my question is - are there any best practices out there, or is this generally a bad idea? I'm also interested in things like warp divergence - for instance, how efficient would it be to compute string lengths on a large array?

1 Answer 1

6

You can work with chars in C++ AMP as per this blog post: http://blogs.msdn.com/b/nativeconcurrency/archive/2012/01/17/c-amp-it-s-got-character-but-no-char.aspx

IMO warp divergence is no different in string processing as it would be in other algorithms, so I wouldn't pre-worry about that aspect of things. First get it right, then get it fast, then tune it to be faster.

In September we will post on our blog a string processing sample that shows performance benefits with C++ AMP over a CPU multi-core implementation - staty tuned for that. In short, yes it can be worth offloading string manipulation algorithms to accelerators such as the GPU.

Sign up to request clarification or add additional context in comments.

1 Comment

You can find another string processing with C++ AMP here. ademiller.com/blogs/tech/2012/10/c-amp-extras-string-reversal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.