Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

How to fix the CUDA kernel error of 0 valued outputs

General Tech Bugs & Fixes

Max. 2000 characters
Replies

usr_profile.png

User

( 6 months ago )

 

This is the code for a simple neural network coded in c++ using visual studio, I have encountered a rather common CUDA error for this code

#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <cuda.h>
#include <iostream>
#include <stdio.h>
#include <string>
#include <fstream>
#include <string.h>
#include <time.h>
#define LRATE 0.0001
#define BIAS 0.0
#define DEFAULTFILENAME "Default.dat"
#define LAYER1SIZE 2000
#define LAYER2SIZE 1000
#define LAYER3SIZE 200
#define LAYER4SIZE 100
#define LAYER5SIZE 20
#define LAYER6SIZE 10
#define LAYER7SIZE 3
char FName[30];
````Cuda kernels````
__global__ void mulMat(float *A, float *B, float *C, int N, int Nsize)
{
    C[threadIdx.x] = A[threadIdx.x*Nsize + N] * B[N];
}
__global__ void errPush(float *A, float *B, float *C, int N, int Nsize)
{
    C[threadIdx.x] = A[N*blockDim.x+threadIdx.x]*B[N];

}
__global__ void gradPush(float *ErrorDef, float *ActivatedVal, float *GradMat)
{
    GradMat[threadIdx.x*blockIdx.y] = ErrorDef[threadIdx.x] * ActivatedVal[threadIdx.y];

}
__global__ void gradientSub(float *A, float *B)
{
    A[threadIdx.x*blockDim.y + threadIdx.y] = A[threadIdx.x*blockDim.y + threadIdx.y] <
									

what's your interest