-
C++❤️)OpenMP - examples(g++ -fopenmp hello.cpp -o hello코딩Coding/C++__C언어 2022. 6. 28. 23:19728x90
https://goulassoup.wordpress.com/2011/10/28/openmp-tutorial/
https://docs.microsoft.com/ko-kr/cpp/parallel/openmp/a-examples?view=msvc-170
https://www.geeksforgeeks.org/openmp-hello-world-program/amp/// C언어 gcc -o hello -fopenmp hello.c gcc -fopenmp -c -o hello.o hello.c gcc -fopenmp hello.o -o hello // C++ g++ -fopenmp hello.cpp -o hello
$ export OMP_NUM_THREADS=8 $ ./hello Hello from OpenMP thread 7 Hello from OpenMP thread 3 Hello from OpenMP thread 4 Hello from OpenMP thread 5 Hello from OpenMP thread 1 Hello from OpenMP thread 6 Hello from OpenMP thread 2 Hello from OpenMP thread 0
https://goulassoup.wordpress.com/2011/10/28/setting-up-opencl-using-an-nvidia-device-on-ubuntu/#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int err; cl_uint platforms; cl_platform_id platform = NULL; char cBuffer[1024]; err = clGetPlatformIDs( 1, &platform, &platforms ); if (err != CL_SUCCESS) { printf("Error in OpenCL call!\n"); return EXIT_FAILURE; } printf("Number of platforms: %d\n", platforms); err = clGetPlatformInfo( platform, CL_PLATFORM_NAME, sizeof(cBuffer), cBuffer, NULL ); if (err != CL_SUCCESS) { printf("Error in OpenCL call!\n"); return EXIT_FAILURE; } printf("CL_PLATFORM_NAME :\t %s\n", cBuffer); err = clGetPlatformInfo( platform, CL_PLATFORM_VERSION, sizeof(cBuffer), cBuffer, NULL ); if (err != CL_SUCCESS) { printf("Error in OpenCL call!\n"); return EXIT_FAILURE; } printf("CL_PLATFORM_VERSION :\t %s\n", cBuffer); }
https://bisqwit.iki.fi/story/howto/openmp/
https://github.com/ysh329/OpenMP-101
반응형'코딩Coding > C++__C언어' 카테고리의 다른 글
C++❤️SDL2개발 환경 세팅 (0) 2022.06.29 Learn C++❤️in 31 hours 👍⭐️& c++20 Tutorial (0) 2022.06.29 openmpi❤️_설명서 (0) 2022.06.29 C언어] ❤️OpenMP를 사용해서 내 컴퓨터의 가능한 Threads숫자 알아보기 (0) 2022.06.29 C언어❤️) clock()함수로 프로그램 수행 시간 구하기 (0) 2022.06.28 Parallel programming in C++ ❤️with OpenMP (Visual Studio tutorial) (0) 2022.06.28 OpenMP Parallel Programming Full Course: 5 Hours (0) 2022.06.28 C++, ❤️openMP로 병렬프로그래밍을 쉽게! (0) 2022.06.28