- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd like to know how you can use TBB instructions to implement the loop in the following piece of code.The code uses an ipp function and I'd like to be able to use the ipp function with TBB.
#include <iostream>
#include <ipp.h>
#include "tbb/task_scheduler_init.h"
#include "tbb/parallel_for.h"
#include "tbb/blocked_range.h"
#include "tbb/tick_count.h"
using namespace tbb;
using namespace std;
#define SIZE 255
#define N 10
int main(int argc, CHAR* argv[])
{
Ipp8u pSrc[SIZE], pDst
int i;
for (int i = 0; i<SIZE ; i++){
pSrc = (Ipp8u) i;
}
for (size_t i = 0; i<N; i++){
ippsCopy_8u(pSrc,pDst,SIZE); // This is the loop that needs to be implemented in TBB.
}
return 0;
}
I have written the following class to implement the parallel_for. But I still need to know how the structure of the parallel_for would be.
class copyVectors{
Ipp8u *s;
Ipp8u *d;
public:
copyVectors(Ipp8u *pSrc, Ipp8u *pDst){
s = pSrc;
d = pDst;
}
void operator () (const blocked_range<size_t> &r) const {
ippsCopy_8u(s, d, SIZE);
}
}
Any help would be highly appreciated.
http://software.intel.com/en-us/forums/intel-threading-building-blocks/
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page