Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 859874 Details for
Bug 904143
sys-devel/clang does not deploy clang-*-wrapper files
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Usecase that makes use of OpenMP+GPU offload
openmp_offload.c (text/x-csrc), 881 bytes, created by
Adrien Dessemond
on 2023-04-11 12:42:04 UTC
(
hide
)
Description:
Usecase that makes use of OpenMP+GPU offload
Filename:
MIME Type:
Creator:
Adrien Dessemond
Created:
2023-04-11 12:42:04 UTC
Size:
881 bytes
patch
obsolete
>#include <stdio.h> >#include <omp.h> >int main(int argc, char const * argv[]) { > int ndev; > int nteams; > int thread_lmt; > int on_host; > > ndev = omp_get_num_devices(); > printf("number of devices: %d\n", ndev); > for (int i = 0; i < omp_get_num_devices(); ++i) { > #pragma omp target teams \ > device(i) \ > map(from:on_host) map(from:nteams) \ > map(from:thread_lmt) > #pragma omp parallel > #pragma omp master > if (0 == omp_get_team_num()) { > on_host = omp_is_initial_device(); > nteams = omp_get_num_teams(); > thread_lmt = omp_get_thread_limit(); > } > printf("ran on GPU %d: %s, %d teams, " > "limit of %d threads\n", > i, on_host ? "no" : "yes", nteams, thread_lmt); > } > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 904143
: 859874