성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] Detecting blocking calls using asyn...
[정성태] 아쉽게도, 커뮤니티는 아니고 개인 블로그입니다. ^^
[정성태] 질문이 잘 이해가 안 됩니다. 우선, 해당 소스코드에서 ILis...
[양승조
] var대신 dinamic으로 선언해서 해결은 했습니다. 맞는 해...
[양승조
] 또 막혔습니다. ㅠㅠ var list = props[i].Ge...
[양승조
] 아. 감사합니다. 어제는 안됐던것 같은데....정신을 차려야겠네...
[정성태] "props[i].GetValue(props[i])" 코드에서 ...
[정성태] 저렇게 조각 코드 말고, 실제로 재현이 되는 예제 프로젝트를 압...
[정성태] Modules 창(Ctrl+Shift+U)을 띄워서, 해당 Op...
[정성태] 만드실 수 있습니다. 단지, Unity 엔진 내의 스크립트와 W...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>내 컴퓨터에서 C++ AMP 코드가 실행이 될까요?</h1> <p> 공식 홈페이지를 보면,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > C++ AMP Overview ; <a target='tab' href='https://docs.microsoft.com/en-us/cpp/parallel/amp/cpp-amp-overview'>https://docs.microsoft.com/en-us/cpp/parallel/amp/cpp-amp-overview</a> </pre> <br /> 시스템 요구 사항이 다음과 같이 나옵니다.<br /> <br /> <ul> <li>Windows 7, Windows 8, Windows Server 2008 R2, or Windows Server 2012</li> <li>DirectX 11 Feature Level 11.0 or later hardware</li> <li>For debugging on the software emulator, Windows 8 or Windows Server 2012 is required. For debugging on the hardware, you must install the drivers for your graphics card.</li> </ul> <br /> 이런 거 보고 바로 알 수 있으면 좋겠지만 역시나 그냥 프로그램 돌려서 되냐 안되냐를 알 수 있는 것이 속편합니다. ^^ 이에 대해서는 다음의 글에 나오는 "VerifyAmpDevices" 유틸리티를 쓰시면 됩니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Can I Run C++ AMP on My Device? ; <a target='tab' href='http://blogs.msdn.com/b/nativeconcurrency/archive/2011/09/22/can-i-run-c-amp-on-my-device.aspx'>http://blogs.msdn.com/b/nativeconcurrency/archive/2011/09/22/can-i-run-c-amp-on-my-device.aspx</a> </pre> <br /> VerifyAmpDevices 유틸리티는 아래의 글에 포함된 list_all_accelerators() 함수를 이용해 쉽게 만들 수 있습니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Using accelerator and accelerator_view Objects ; <a target='tab' href='https://docs.microsoft.com/en-us/cpp/parallel/amp/using-accelerator-and-accelerator-view-objects'>https://docs.microsoft.com/en-us/cpp/parallel/amp/using-accelerator-and-accelerator-view-objects</a> </pre> <br /> 뭐 대충 이런 식입니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > #include "stdafx.h" #include <amp.h> #include <vector> #include <amprt.h> #include <iostream> using namespace Concurrency; // https://docs.microsoft.com/en-us/cpp/parallel/amp/using-accelerator-and-accelerator-view-objects void list_all_accelerators(); int _tmain(int argc, _TCHAR* argv[]) { list_all_accelerators(); return 0; } void list_all_accelerators() { std::vector<accelerator> accs = accelerator::get_all(); for (int i = 0; i < accs.size(); i++) { std::wcout << accs[i].device_path << ", desc = "; std::wcout << accs[i].description << ", has_display = "; std::wcout << accs[i].get_has_display() << ", is_emulated = "; std::wcout << accs[i].is_emulated << "\n"; //std::wcout << accs[i].dedicated_memory << "\n"; //std::wcout << (accs[i].supports_cpu_shared_memory ? // "CPU shared memory: true" : "CPU shared memory: false") << "\n"; //std::wcout << (accs[i].supports_double_precision ? // "double precision: true" : "double precision: false") << "\n"; //std::wcout << (accs[i].supports_limited_double_precision ? // "limited double precision: true" : "limited double precision: false") << "\n\n"; } } </pre> <br /> 제 컴퓨터에서 위의 코드를 실행하면 다음과 같은 출력 결과가 나옵니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > PCI\...[장치경로]..., desc = NVIDIA GeForce GTX 660 , has_display = 1, is_emulated = 0 direct3d\warp, desc = Microsoft Basic Render Driver, has_display = 0, is_emulated = 1 direct3d\ref, desc = Software Adapter, has_display = 1, is_emulated = 1 cpu, desc = CPU accelerator, has_display = 0, is_emulated = 1 </pre> <br /> 당연히 is_emulated = 0인 값의 장치가 가장 성능이 우수할 것입니다. 또한 has_display는 현재 모니터 장치와 연결된 것을 의미한다고 하는데, direct3d\ref가 has_display = 1을 갖는 의미가 뭔지는 해석이 안되는군요. ^^<br /> <br /> 참고로, 중간의 warp와 ref에 대해서는 다음의 글에 약간의 설명이 나옵니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > concurrency::accelerator ; <a target='tab' href='http://www.danielmoth.com/Blog/concurrencyaccelerator.aspx'>http://www.danielmoth.com/Blog/concurrencyaccelerator.aspx</a> </pre> <br /> <ul> <li>accelerator::direct3d_ref represents the reference rasterizer emulator that simulates a direct3d device on the CPU (in a very slow manner). This emulator is available on systems with Visual Studio installed and is useful for debugging. More on debugging in general in future posts. Example: accelerator acc(accelerator::direct3d_ref); </li> <li>accelerator::direct3d_warp represents WARP which is the current CPU fallback. Example: accelerator acc(accelerator::direct3d_warp); </li> </ul> <br /> ref는 Visual Studio가 설치된 경우에 있으며 디버깅이 쉽다는 장점이 있다고 하니, 그렇다면 일반적인 컴퓨터라면 GPU 하나와 direct3d\ref, cpu 정도만 AMP 장치로 검색될 것입니다.<br /> <br /> 아래의 글도 읽어보면 좋을 듯 싶군요. ^^<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Server environments and C++ AMP ; <a target='tab' href='http://blogs.msdn.com/b/nativeconcurrency/archive/2012/06/21/server-environments-and-c-amp.aspx'>http://blogs.msdn.com/b/nativeconcurrency/archive/2012/06/21/server-environments-and-c-amp.aspx</a> </pre> </p><br /> <br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1104
(왼쪽의 숫자를 입력해야 합니다.)