开发者

Detect bottleneck on program and use opencl to speedup

开发者 https://www.devze.com 2022-12-17 11:23 出处:网络
I am new to OSX and mac. I have some old number crunching programs. I wonder what are the best approaches in OSX to

I am new to OSX and mac. I have some old number crunching programs. I wonder what are the best approaches in OSX to

1) find the bottlenecks in the program. I read that the best is to use Xcode and 开发者_StackOverflowprofiling tools, but this is not clear to me which one of this tools is the best one

2) once the bottlneck is found, what is the best approach to change the smallest possible part of the code and translate it into opencl equivalent, so one gets a decent overall speedup. I guess there is a lot of approaches here, just wanted to hear from you what is the best place to start from

Thanks


For (1), I would start with Shark, if only because it's by far the simplest tool to use. Just launch Shark, point it at your program, and click the button to collect samples. It will give you pretty good sampling data that should show you what routines (or stretches of code) are the bottlenecks. You may find it helpful to build your programs with debug info -g, as it can make the Shark traces a bit easier to read.

For (2), without knowing more about what you're doing, it's impossible to know if OpenCL is suitable for your problem or not. Find the bottlenecks first, then think about how to solve them. Don't get locked into the idea of using one technology or another before you know what you'd be using it for.

0

精彩评论

暂无评论...
验证码 换一张
取 消