- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
We found that the ippsWinKaiser_32f_I() method is not thread safe, an example is attached to this message.
In our example we create a sinus wave as input vector and run the ippsWinKaiser_32f_I() method and store the result as "expected" result. We then launch multiple threads running the ippsWinKaiser_32f_I() method again with the same input vector and compare the "expected" result against the new computation. We abort the test routine if any result does not match.
The test program fails every time until we protect the call to ippsWinKaiser_32f_I() with a mutex. Without mutex the example always fails, with mutex all tests were good.
Any suggestions how to fix this or is this a bug?
Best regards,
Oliver
P.S.: ippsWinHann_32f_I() and ippsWinHamming_32f_I() are working as expected
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an unexpected behavior as IPP is not internally threaded library.
I didn't run this example, but I see that you compare like as follows: computed != expected
which is not correct in the case of floating point data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I asked Microsofts KI for better comparision methods of two std vectors of floats:
bool compareVectors(const std::vector<float>&vec1, const std::vector<float>&vec2) {
if (vec1.size() != vec2.size()) {
return false;
}
float epsilon = 0.1f;
for (size_t i = 0; i < vec1.size(); ++i) {
if (std::abs(vec1[i] - vec2[i]) > epsilon) {
return false;
}
}
return true;
}
Now I observe the following difference (which disappears once I mutex lock the calls):
Left expected (correct), right when error occurs. I even once saw an INF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I asked the KI how to properly compare two std::vectors of type float:
bool compareVectors(const std::vector<float>&vec1, const std::vector<float>&vec2) {
if (vec1.size() != vec2.size()) {
return false;
}
float epsilon = 0.1f;
for (size_t i = 0; i < vec1.size(); ++i) {
if (std::abs(vec1[i] - vec2[i]) > epsilon) {
return false;
}
}
return true;
}
I still get the errors (left expected, right new computation):
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oliver,
yes, we have to confirmed that we see the same behavior as you reported.
The problem will be escalated internally and we will keep you informed with the status.
--Gennady
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/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