- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there any way to use abstraction and _Cilk_shared. In normal C++ you can just do
[cpp]
abstract_class * classp;
classp = new base_class();
[/cpp]
To use new using _Cilk_shared one must perform a vector to wrap the class as seen in http://software.intel.com/sites/default/files/article/326700/effective-use-of-compiler-features-for-offload.pdf at the end of page 14. However if the base class is abstract how does one do this as one cannot create a abstract class.
Cheers, Mark
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#pragma offload_attribute(push,_Cilk_shared)
#include "offload.h"
#pragma offload_attribute(pop)
class _Cilk_shared abstract_base_class {
public:
virtual void f() = 0; // Pure virtual function.
};
class _Cilk_shared derived_class : public abstract_base_class
{
public:
virtual void f() {}
};
_Cilk_shared
void f()
{
derived_class *p = (derived_class *)_Offload_shared_malloc(sizeof(derived_class));
_Offload_shared_free(p);
}
}
The example above shows how to allocate and free objects using _Cilk_shared memory.

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