Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Help for AMD64 machine

mukarmxu
Beginner
247 Views

Mr Vladimir:

I did face detection using IppiApplyhaarclassifier function in application programm and WDM driver,but I got defferent result: success in app programm (got the face), failed in driver. It was surprise to me. Why?

the result is followed:

in app programm:

0:positive : 1226
1:positive : 837
2:positive : 427
3:positive : 228
4:positive : 201
5:positive : 152
6:positive : 75
7:positive : 43
8:positive : 17
9:positive : 14
10:positive : 9
11:positive : 5
12:positive : 2
13:positive : 2
14:positive : 1
15:positive : 1
16:positive : 1
17:positive : 1
18:positive : 1
19:positive : 1

In driver:

0:positive : 1551
1:positive : 0

Source code is same completely.

The followed is my reply to your reply:

///////////////////////////////////////////////////////////////////////////////////////////////////

I do not think it is related to memory allocation, our IPP kernel mode driver example show how to write wrappers for malloc functions which required in some IPP functions internally.

It looks like

void* malloc(size_t size) { ExAllocatePool(...) }

>> In driver code malloc function is followed:

PVOID AllocateMemory(ULONG ulSize)

{

PVOID pBuffer = ExAllocatePool(NonPagedPool, ulSize);

if(!pBuffer) DbgPrint("Allocate memory %d failed ", ulSize);

//DbgPrint("~~~~~~~~~~~~ Allocate buffer : 0x%08x Length : 0x%04x ", pBuffer, ulSize);

return pBuffer;

}

In app code malloc function is followed:

PVOID AllocateMemory(ULONG ulSize)

{

PVOID pData = malloc(ulSize);

&n bsp; if (!pData) printf("Alloc Memory %d is failed!", ulSize);

memset(pData, 0, ulSize);

return pData;

}

So the reason of that difference is not quite clear.

Your source code might look identically but what about source data? Are they the same?

>> Yes, I used the same image.

Could you please share example of your user mode code for us to check if you call function correctly?

>> (check Attachment)

You also may need to care about keeping FPU/SSE state in case of switching threads.

>> I did not use FPU/SSE state in kernel mode. But what should I attention to? Thanks.

Regards,

Vladimir

////////////////////////////////////////////////////////////////////////////////////

By the way:

Platform is 64bit WinVista. CPU is AMD64.

In user mode is success, but failed in kernel mode.The question puzzled me long time.I am eager to your help.

0 Kudos
1 Reply
Vladimir_Dudnik
Employee
247 Views

Hello,

to be honest I have no idea why you get different results on AMD64 system. My the first guess was that IPP functions you call use FPU/SSE units so you need to care about saving/restore FPU/SSE stage at thread switch but our IPP kernel mode sample also call IPP functions which use SSE inside and show no problem. Did you try test on Intel EM64T system? Did yo try your test in Windows XP system?

Did you try IPP kernel mode sample to see if it produces correct results?

Regards,
Vladimir

0 Kudos
Reply