arrow_back_ios Back to List

DOMAIN_ENTRY_NOT_FOUND_CALLED_DUP

Offload KB - faq

Old Content Alert

Please note that this is a old document archive and the will most likely be out-dated or superseded by various other products and is purely here for historical purposes.

"Help! I try to run an __offload block but at runtime I get DOMAIN_ENTRY_NOT_FOUND_CALLED_DUP printed to the TTY!"Any runtime error that prints DOMAIN_ENTRY_NOT_FOUND_CALLED_DUP from the SPU means there is a problem with a virtual function within your code - specifically that a specific Offload™ duplication of a function is not present in the virtual domain.

struct Foo
{
	virtual int bar(int * pointer)
	{
		return 13;
	}
};

static void func()
{
	Foo foo1;
	int temp1 = 53;
	__blockingoffload[Foo::bar]()
	{
		int temp2 = 42;
		foo1.bar(&temp1); // will fail at runtime with a DOMAIN_ENTRY_NOT_FOUND_CALLED_DUP error
		foo1.bar(&temp2); // will succeed at runtime
	};
}

So why is this the case? For virtual domain functions specified in the domain, Offload™ defaults all pointer arguments to be local SPU pointers. Attempting to call the virtual function with an outer PPU memory pointer therefore fails. To get around this, two definitions must be placed in the virtual domain.

struct Foo
{
	virtual int bar(int * pointer)
	{
		return 13;
	}
};

static void func()
{
	Foo foo1;
	int temp1 = 53;
	__blockingoffload[Foo::bar, (int (Foo::*)(__outer int * ))&Foo::bar]()
	{
		int temp2 = 42;
		foo1.bar(&temp1); // will succeed at runtime<em>
		foo1.bar(&temp2); // will succeed at runtime
	};
}

In the above example, the domain has an extra item - (int (Foo::*)(__outer int * ))&Foo::bar.Another example where you may get a DOMAIN_ENTRY_NOT_FOUND_CALLED_DUP error is the following.

struct Foo
{
	virtual int bar()
	{
		return 13;
	}
};

static void func()
{
	Foo foo1;
	__blockingoffload[Foo::bar]()
	{
		foo1.bar(); // will succeed at runtime
		Foo foo2;
		foo2.bar(); // will fail at runtime with a DOMAIN_ENTRY_NOT_FOUND_CALLED_DUP error
	};
}

The reason this example fails to run is that virtual domain functions assume outer PPU memory this pointers. To correct the problem we add another function to the virtual domain.

struct Foo
{
	virtual int bar()
	{
		return 13;
	}
};

static void func()
{
	Foo foo1;
	__blockingoffload[Foo::bar, Foo::bar this]()
	{
		foo1.bar(); // will succeed at runtime
		Foo foo2;
		foo2.bar(); // will succeed at runtime
	};
}

Content has been removed.

A helpful command line option that will show all the virtual functions called from within an offload block can be found /kb/25.html.

Share