C , C++, C#

[C++] restrict keyword: AMP(Accelerated Massive Parallelism)

vhxpffltm 2022. 7. 4. 20:53
반응형

뭐 분석 오류로 인해서 보고 있었는데

 

우선 Visual Studio의 이친구였다...

 

우선 난 첨본다.. 찾아보면 아래에서 알 수 있다.

 

https://docs.microsoft.com/ko-kr/cpp/parallel/amp/cpp-amp-overview?view=msvc-170 

 

C++ AMP 개요

자세한 정보: C++ AMP 개요

docs.microsoft.com

 

아아아~~ C++의 GPU 기능과 병렬처리를 통해 속도를 빠르게 할 수 있는거구나 그런데 

 

Visual Studio 2022 버전 17.0 부터는 사용을 안하는구나..!?

 

하고 넘어가면 될듯하다.

 

안에 기본 예제 정도가 있으니 한번 따라해보면 되는데 내 문제는 아래 헤더 파일의 내용이다.

 

 

흠.. restrict..? 아 이 친구가 문제였는데..

 

이렇게 매크로로 정의되어 있는 친구였는데 얘의 Type과 Symbbol 정의를 알고 싶었다.

 

해당 헤더 파일을 보면 런타임시의 AMP 코드를 확인할 수 있다. 

 

restrict 키워드가 이렇게 VS의 매크로 값으로 있음을 알면 된다.

 

이 키워드는 __restrcit 혹은 restrcit 키워드가 혼용될 수 있기 떄문에 컴파일러마다 잘 확인하자는 면에서 중요하다.

 

https://en.cppreference.com/w/c/language/restrict

 

restrict type qualifier - cppreference.com

Each individual type in the C type system has several qualified versions of that type, corresponding to one, two, or all three of the const, volatile, and, for pointers to object types, restrict qualifiers. This page describes the effects of the restrict q

en.cppreference.com

 

https://docs.microsoft.com/en-us/cpp/cpp/extension-restrict?view=msvc-170 

 

`__restrict`

Describes the Microsoft Visual C++ `__restrict` keyword.

docs.microsoft.com

 

참고로 위 링크의 내용도 첨본다..

반응형