Click here to Skip to main content
15,798,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is my code that calls a cuda API,i run it in visual studio 2008.it opens an window but doesn't show anything!can u tell me what is my problem?how can i fix it?

#include <iostream>
#include <stdio.h>
#include <cuda.h>
#include <conio.h>
#include <windows.h>
int main()
{
    HRESULT __stdcall NVGetHWEncodeCaps();
    getch();
    return 0;
}


'num2.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'num2.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'num2.exe': Loaded 'C:\Windows\System32\KernelBase.dll'
'num2.exe': Loaded 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.2\bin\cudart64_42_9.dll', Binary was not built with debug information.
The thread 'Win64 Thread' (0x28c) has exited with code -1073741510 (0xc000013a).
The program '[2648] num2.exe: Native' has exited with code -1073741510 (0xc000013a).

---
API:
NVGetHWEncodeCaps
Description:
Query if the GPU supports the NVIDIA CUDA Video encoder
Syntax:
HRESULT __stdcall NVGetHWEncodeCaps(void)
Parameter:
None
Return Value:
S_OK: CUDA based encoding is supported
E_FAIL: No CUDA capability present
Remarks:
None
Posted
Updated 30-Jul-12 5:09am
v2

1 solution

The proper way to call the function would be
C++
HRESULT hr = NVGetHWEncodeCaps();
if (FAILED(hr))
{
 // handle error
}
//...
 
Share this answer
 
Comments
sprb9 30-Jul-12 6:59am    
i write your code but it has error:
error: identifier "NVGetHWEncodeCaps" is undefined


int main()
{

HRESULT hr = NVGetHWEncodeCaps();
if (FAILED(hr))
{
printf("failed"+hr);
}
else
printf("ok"+hr);
getch();
return 0;

}
i want to see the output of this function.plz help!
Albert Holguin 30-Jul-12 10:11am    
If it's undefined, then you're probably not including the header properly or your function prototype doesn't match what's on the header.
sprb9 30-Jul-12 13:18pm    
is my code true?
Albert Holguin 30-Jul-12 13:20pm    
Is your code true? ...not sure I understand what you're asking.
sprb9 30-Jul-12 16:01pm    
thanks,i find the correct library!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900