- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a source code:
#include<offload.h> #include<stdio.h> int main() { int ndev = _Offload_number_of_devices(); printf("Ndev = %d\n", ndev); void *u; for (int d = 0; d < ndev; d++) { #pragma offload target(mic: d) nocopy(u) { u = malloc(1); // 1 is just for demo, it's actually nz*ny*nx in my application printf("u on %d is %x\n", d, u); fflush(0); } } for (int d = 0; d < ndev; d++) { #pragma offload target(mic: d) nocopy(u) { printf("u on %d is %x\n", d, u); fflush(0); } } return 0; }
I have a server with 2 Intel Xeon Phi installed.
I found an issue is the address of pointer u on device 0 is changed after the malloc on device 1
Here is the output:
Ndev = 2 u on 0 is ac000b30 u on 1 is 60000b30 u on 0 is 60000b30 u on 1 is 60000b30
Then any access operation on u in MIC(device 0) will get segfault as the pointer address is changed.
Please help
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a defect with data persistence of a local variable in the current (CXE 2013 SP1) release that is fixed in the next major release planned for later this year. It is related to an earlier discussion here.
You can work around this by temporarily using static as in:
__declspec(target (mic)) static void *u;
The Beta program for the next major release is currently underway. If you interested in participating in our Beta program, please refer to the invitation posted in our User Forum: Invitation to join the Intel® Software Development Tools 2015 Beta program
Our apologies for the inconvenience of this defect.
(Internal tracking id: DPD200245213)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page