- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Warning #2259 is caused when compile parallel_for with icpc(15.0) -Wall -Wcheck.
#include <tbb/parallel_for.h> void f(void) { using namespace tbb; parallel_for(0,1,1, [&](int) {} ); }
$ icpc -Wall -Wcheck pfor.cpp -std=c++11 -c -I /opt/intel/tbb/include/ /opt/intel/tbb/include/tbb/partitioner.h(185): warning #2259: non-pointer conversion from "int" to "tbb::interface7::internal::depth_t={unsigned char}" may lose significant bits my_head = (my_head + MaxCapacity - 1) % MaxCapacity; ^ detected during: <..snip..>
Is it safe? How do I disable it?
Thanks.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is safe, because both sides of the modulo operator will be positive (which the compiler does not know about the left side), and MaxCapacity is the same type as the destination, so that's sufficient for the result to be passed undamaged to my_head. A workaround could be to use "(depth_t)1".
(2014-12-11 Edited) MaxCapacity is the same type as the "destination", not the "result".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Raf, thanks for your reply.
Modifying TBB header is not allowed because of my source code is compiled on some machines.
I will disable it by -diag-disable 2259.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
our developers looked at this and it looks that compiler 15.0 update 1 fixed this particular diagnostics.
--Vladimir
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page