|
Where is the implementation of KernelFireLayer() . Once again you are calling some function in your code that is not being included in your link process. I have no idea what part of this is code that you have written and what part comes from some external library, but that seems to be the issue you need to resolve.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
There is no external library, i Just posted the header of the function.
Obviously the bug is here i think, for all those functions LNK2019 occurs. But i dont know what this __entry means.
So it looks that because :Fire(cudaStream_t stream) has just 2 parameters and inside functions much more and they are not seen
from inside of Fire function so LNK2016 occurs. Do you agree with me ??
this cudaStream_t stream can not find anywhere how it is defined
Its not my code BTW.
void CudaMultipleBackPropagation::DeviceLayer::Fire(cudaStream_t stream) {
if (isOutputLayer) {
if(connections > MAX_THREADS_PER_BLOCK) {
KernelFireOutputLayer(stream, dimNeuronsPatterns, inputsBlockSize, inputValues, weights.Pointer(), m, mOffset, neuronsWithSelectiveActivation, desOutputs, outputs.Pointer(), localGradient.Pointer(), rms, lgSpaceNet, inputsWithoutBias);
} else {
FireOutputLayer<<<patterns, dimInputsNeurons, sharedMemFire, stream>>>(inputValues, weights.Pointer(), m, mOffset, neuronsWithSelectiveActivation, desOutputs, outputs.Pointer(), localGradient.Pointer(), rms, lgSpaceNet);
}
} else {
if(connections > MAX_THREADS_PER_BLOCK) {
KernelFireLayer(stream, dimNeuronsPatterns, inputsBlockSize, inputValues, weights.Pointer(), m, mOffset, neuronsWithSelectiveActivation, outputs.Pointer(), inputsWithoutBias);
} else {
FireLayer<<<patterns, dimInputsNeurons, sharedMemFire, stream>>>(inputValues, weights.Pointer(), m, mOffset, neuronsWithSelectiveActivation, outputs.Pointer());
}
}
}
<pre>KERNEL FireLayer(CUDA_FLOATING_TYPE * inputs, CUDA_FLOATING_TYPE * weights, CUDA_FLOATING_TYPE * m, int mOffset, int totalNeuronsWithSelectiveActivation, CUDA_FLOATING_TYPE * outputs) {
extern __shared__ CUDA_FLOATING_TYPE iw[];
int connection = NEURON * NUM_INPUTS_INCLUDING_BIAS + INPUT;
SumInputWeight(connection, inputs, weights);
if (INPUT == 0) {
int n = PATTERN * NUM_NEURONS + NEURON;
CUDA_FLOATING_TYPE output = CUDA_SIGMOID(iw[THREAD_ID]);
if (m != NULL) output *= m[PATTERN * totalNeuronsWithSelectiveActivation + NEURON + mOffset];
outputs[n] = output;
}
}
</pre>
<div class="signature"><div class="modified">modified on Sunday, March 28, 2010 7:27 PM</div></div>
|
|
|
|
|
Krzysiaczek99 wrote: :Fire(cudaStream_t stream) has just 2 parameters
That's one parameter.
Krzysiaczek99 wrote: But i dont know what this __entry means.
Just a way the compiler has of generating entry point names.
It certainly looks like there are some mismatches between function calls and definitions. Since this is not your code your first port of call should have been the person whose code it is rather than posting it here. I suggest you try that route now.
txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Yes i will speak to him. I think he forgot to give (cudaStream_t stream) file with this class definition, I already found this file in another release of his code
|
|
|
|
|
Are you trying to use Nvidia's CUDA or are you trying to link in a lib file that you compile yourself? If the former, is this your first project using CUDA? I think there are several examples you can download.
|
|
|
|
|
No its not my fist CUDA project but not my code. Anyway the reason of those errors is missing library with one class.
|
|
|
|
|
Hi all
I have a VB project that I wish to port to VC. The VB project makes use of a dll file, for which I do not have a .lib or .h file. is there any way I can do what I am trying to do?
Sorry if this is a dumn question!
Cheers
Mike
|
|
|
|
|
Assuming you have the VB source code, you will just need to convert the dll function declarations to C++ declarations.
|
|
|
|
|
Thanks for taking the time to help!
Previously when I have done a similar thing to this, I have had an associated header and lib file. I would normally go to Projects, settings, and add "MyLib.lib" to object\library modules. Is there another way of adding the dll to the project?
Again thanks for any help
Mike
|
|
|
|
|
Well, since you don't have a .lib file for the dll, I don't see that you need to add it to the project, per se.
In order to call the functions in the dll you'll have to use LoadLibrary , and GetProcAddress .
Are you familiar with those two functions?
|
|
|
|
|
no - just looking them up!
|
|
|
|
|
well, Im part of the way there!
I have tried this:
HINSTANCE hDLL = NULL;
FARPROC DLLFunc;
hDLL = LoadLibrary("MyDLL.dll");
if(hDLL)
{
DLLFunc = GetProcAddress(hDLL,"MyFunction");
FreeLibrary(hDLL);
}
I get a handle to the dll, but GetProcAddress fails. I have tried this with a different dll, and this appeared to work, so may be there is something unusual with MyDLL.dll - is there a way of finding out what functions are in the dll?
The VB program declares a variable as well - "Dim WithEvents obj As CVeronixCtl" how would this be handled?
Thanks again for your time and patience!
Mike
|
|
|
|
|
The spelling of the function name in GetProcAddress must be exact.
You can also try calling GetLastError like this:
DWORD Error = 0;
DLLFunc = GetProcAddress(hDLL, "MyFunction" );
if ( ! DLLFunc )
Error = GetLastError();
This will tell you the reason that the call failed.
You can find out the exported functions inside the DLL, by using the program Dumpbin that comes with the SDK.
dumpbin /EXPORTS MyDll.dll
|
|
|
|
|
I am trying to figure out why ReadFile returns different values when I step thru the program and when I run it. Both in debug mode. I am using ReadFile to get data from COM port.
When stepping thru it returns expected ERROR_IO_PENDING, but when running it returns “The system cannot find the file specified”.
I am checking for ERROR_IO_PENDING and do GetLastError when it fails.
The GetLastError returns the above missing file message.
I can do WaitForSingleObject using timeout. I do not have my program finished so I cannot actually do any real data reading from the COM port.
My guess is that I have some error in my setup and the ERROR_IO_PENDING message is masking it.
Any constructive comments as always are appreciated.
Thank you for your time.
Vaclav
Update
I found one error in my setup - the receiving buffer size was not defined.
Now I am getting the “The system cannot find the file specified” all the time - consitently. I think I can fix it now.
Solution / lesson learned :
When using an API which has GetLastError option use it before you do any API return value processing. My ill-conceived program logic - checking the return value first - got me into trouble.
-- Modified Sunday, March 28, 2010 10:47 AM
|
|
|
|
|
Probably posting the relevant code would help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OK here is the code - just the base:
iResult = ReadFile(m_hFile,pData,dwBytes,pdwRead,&osRead);
if (!iResult) {
long lLastError = ::GetLastError();
if (lLastError == ERROR_IO_PENDING)
{
....
TRACE("ReadFile(m_hFile,&pData,1,pdwRead,NULL)) ERROR_IO_PENDING \n ");
}
else
{
....
TRACE("ReadFile(m_hFile,&pData,1,pdwRead,NULL)) Unknown errof - read failed \n ");
pSupport = new COpenHR_Support;
pSupport->GetLastError_("Failed \nReadFile(m_hFile,&pData,1,pdwRead,&osRead)",lLastError);
}
}
else
{
.....
}
|
|
|
|
|
Guys,
Iam working with sqlite using c++, while i am trying to creating tables iam getting exception CppSQLite exception. I was already added CppSQLite3.h as header file. What i written is:
CppSQLite3.h
const *char gszfile="d:\\temp.db";
CppSQLit3DB db;
db. execDML("create table emp(cc varchar(20), subject varchar(30)");
i need solution for this, plz give me with more explanation.
|
|
|
|
|
You did not open the database.
|
|
|
|
|
hOW CAN I OPEN THE DATABASH
|
|
|
|
|
For example, your code looks like this:
const *char gszfile="d:\\temp.db";
CppSQLit3DB db;
db. execDML("create table emp(cc varchar(20), subject varchar(30)"); You are missing this before you call execDML:
db.open(gszfile); When you execute the command without opening the database, you sure will get an exception.
|
|
|
|
|
Thnx to your reply, eventhough iam trying with ur solution, still same exception exist. The exception like:
c++ exception at memory location 0x0000012ee8e
|
|
|
|
|
What line is throwing the exception?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
David,
as finally i can able tog get the solution to create and insert data into sqlite tables. Now i want to display the data into listview/ treeview control, how can i get the records from existed table. Can u suggest me something.
Regards
KiranKumar
|
|
|
|
|
I have not met this type of trouble before. I am assuming that you are using the wrapper found here:
CppSQLite - C++ Wrapper for SQLite[^]
I liked that wrapper when I first read that article, but to be honest I never used it. My projects either used direct C function calls to the Sqlite library, or used a wrapper that is an enhancement of the wrapper found here:
An Easy to Use Wrapper for SQLite3 (Totally Free Embedded Database Engine!)[^]
To solve your problem, I will need to have a closer look at your code. Since you have the source code of everything, you surely can trace into the source code to pinpoint the problem. You might have discovered some problems in the wrapper, not in your code. Sqlite is always very friendly to me; surely it will be friendly to you.
Good luck!
|
|
|
|
|
bool OpenSQLite(CString sDatabaseFilePath)
{
int nRet = sqlite3_open16((char*)(LPCTSTR)sDatabaseFilePath, &m_pSQLiteDB);
if (nRet != SQLITE_OK)
{
return false;
}
return true;
}
void CloseSQLite()
{
if (m_pSQLiteDB)
{
sqlite3_close(m_pSQLiteDB);
m_pSQLiteDB = 0;
}
}
bool ExecuteQuery(CString sQuery)
{
if(!m_pSQLiteDB)
return false;
sqlite3_stmt* pVM = 0;
const TCHAR* szTail = 0;
int nRet = sqlite3_prepare16(m_pSQLiteDB,(char*)(LPCTSTR)sQuery,sQuery.GetLength()*sizeof(TCHAR), &pVM, (const void**)&szTail);
if(nRet != SQLITE_OK)
{
const char* szError= sqlite3_errmsg(m_pSQLiteDB);
return false;
}
nRet = sqlite3_step(pVM);
if(nRet ==SQLITE_DONE)
{
// u can use results
}
else if (nRet == SQLITE_ROW)
{
// row by row
}
else
{
sqlite3_finalize(pVM);
return false;
}
return true;
}
|
|
|
|
|