Friday, June 29, 2012 4:49 PM
I did some experiments with APO.
I took the SwapAPO sample from WinDDK(C:\WinDDK\7600.16385.0\src\audio\sysfx) created a Visual studio 2012 DLL Project. Incorporated the CPP AMP chnages to it. Built the project for x86. it also requires propertypageextension dll(allso part of sample). installed this swapAPO for the HDAudio Codec using the INF file present in the sample. I took the Pick_accelerator function from the one of your presentation and invoked it from the APO Initialize function. Inside Pick_accelerator the count obtained was 3 but the vector had NULL. where as a stand alone application(Hello world) returned a vector of siz 3 and one of them was GPU. I was using windDBg as debugger and captured the data when the pick_accelerator returned. Attaching the watch window for your reference.
Friday, June 29, 2012 5:46 PMOwner
The screenshot did not come through; it is all black (or all white in another browser). I am afraid there isn’t much to go on with so little information, but I’ll throw some questions out shooting in the dark until you provide more info.
Did I understand you correctly that on the same machine you have two apps where one can enumerate all the devices and on the other there are none returned? What is your exact question with expected results and actual results?
Which pick_accelerator function did you use (we have various example versions around), can you share the actual code?
You said in one app you could see 3 devices, which leads me to believe you could see REF (only useful for debugging), CPU (not useful for executing code in this release), and the physical accelerator. What is the accelerator on your system? Do you have the latest drivers for it?
Is this on Windows 7 or on Windows 8? I suspect Windows 7, or you would have seen a 4th accelerator (WARP), but I am just checking.
Have you tried our samples on that machine and do they execute on the hardware?
Saturday, June 30, 2012 3:32 AM
Sorry for missing some basic informations
OS: Win7 32 bit
Accelerator: AMD Radeon 6xxx
Latest Graphics driver is installed.
Yes, both the applications were running on the same Machine. SwapAPO is a DLL(will be below Audio Engine and will be part of AudioDg process) and Hello world is a Amp Sample.
For both the apps I added Pick_accelerator function and invoked them during initialization.
Was Debugging SwapAPO in WInDBG, Where as Hello World in VS2012.
While debugging SwapAPO I remember seeing DefaultAcc + CPU + REF + WRAP. I will reheck and confirm.
On the Helloworld I was clearly getting as AMD Radeon 6xxx( Count was 3, I will recheck and confirm what are those devcies)
MY Pick_Accelerator function
//get all Accelerators known to the C++ AMP runtime
vector<accelerator> accs = accelerator::get_all();
//empty ctor returns the one picket by the runtime by default
auto result = std::find_if(accs.begin(), accs.end(), (const accelerator& acc)
if(result != accs.end())
//else not shown
//output its description (tip: explore the other properties)
//std::wcout << chosen_one.description<< std::endl;
std::wcout << chosen_one.description<< std::endl;*/
Tuesday, July 03, 2012 2:10 PM
Looks like it was an issue with debugging in Windbg. I used VS2012 for further debugging and it was showing proper results that the pick_accelerator function was able to get GPU as accelerator.
I tried offloading CPU by returning cpu_accelerator, but i was getting GPU instead.
Is there way I can get cpu_accelerator on WIn7?
Tuesday, July 03, 2012 5:07 PM
You can create a cpu_accelerator by:
However, for this release, cpu_accelerator does not support computation. The main purpose of it is for creating staging array. You can also create an concurrency::array that is accessible on host code, but that's probably not very meaningful.
Tuesday, July 03, 2012 9:26 PMOwner
Sounds like you answered your own question.
Your new question is how to target the CPU isntead of a GPU from C++ AMP, and the answer is WARP on Windows 8, and we hope to have a solution for Windows 7 by the time we ship although that is not certain at this point. Regarding the CPU accelerator, please read our blog post (in addition to Weirong's response):
- Marked As Answer by DanielMothMicrosoft Employee, Owner Friday, July 13, 2012 6:05 AM