- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am trying to offload the argv vector on MIC and I was wondering what would be the right path to follow.
I found out here : https://software.intel.com/en-us/forums/intel-many-integrated-core/topic/534766
that "The offload run-time dynamically determines the length of each string element and transfers each element accordingly."
by using something like:
#pragma offload target(mic) in(argv[0:argc])
error: variable "argv" used in this clause must point to a non-pointer type and not "char *"
Any suggestions?
Nikos
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I faced a similar problem in one of my projects. Check Array of pointers. (argv is a char** )
https://software.intel.com/en-us/articles/effective-use-of-the-intel-compilers-offload-features.
Hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank Ashwin,
Indeed, that was the part I was missing. I managed to offload argv as a normal array of pointers.
Nikos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think either I don't understand what you are doing or what you are doing is not really what you want to do.
In the article Ashwin pointed to, what it was saying was - if you have an array of pointers, then you need to pass each thing pointed to one at a time. They had an array of pointers to blocks of malloc memory. If the compiler allowed them to offload that array, (assuming they are not using _Cilk_shared) what they would see on the coprocessor is an array of pointers pointing to who knows what, but definitely not their blocks of malloc'ed memory. They had to pass each block of memory individually. In your case, this would be the same as passing each argument individually as an array of char.
Typically when you use the offload method of writing code for the coprocessor, you do some work on the host system, then pass the highly parallel parts of the work to the coprocessor. In this case, you would normally have already parsed argv on the host and would pass to the coprocessor the variables you created using those arguments. If you are starting your code up on the host system then immediately passing everything to the coprocessor, you might want to look into running the code natively on the coprocessor.
![](/skins/images/3344F5B3B76C91485ED0E980FD0CA95E/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page