Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- There is no way the "data_in" kernel would deadlock without printing anything. If you don't get any output from that kernel at runtime, it is possible that there is something wrong with your host code. I have no idea how Altera implements printf, though; there might be implementation-specific details that block the printf calls. Needless to say, you definitely have an ordering issue in reading and writing CONV1_BIAS and CONV1_WEIGHTS; you are first writing CONV1_WEIGHTS and then CONV1_BIAS, while reading them in the opposite direction. This is very likely one major (or the only) source of your problem. --- Quote End --- Thanks for your reply! First, about printf, "Intel FPFA for opencl programming guide" says: "During kernel execution, printf data is stored in a global printf buffer that the Intel FPGA SDK for OpenCL Offline Compiler allocates automatically. The size of this buffer is 64 kB; the total size of data arguments to a printf call should not exceed this size. When kernel execution completes, the contents of the printf buffer are printed to standard output. Buffer overflows are handled seamlessly; printf instructions can be executed an unlimited number of times. However, if the printf buffer overflows, kernel pipeline execution stalls until the host reads the buffer and prints the buffer contents. Because printf functions store their data into a global memory buffer, the performance of your kernel will drop if it includes such functions". So, I think my printf information stored in the buffer? Becaue in emulator mode,my code result is right, so i think the host code is right? The host code have four queus, every kernel correspond to on queue. Second, I have changed the sequence of reading and writing CONV1_BIAS and CONV1_WEIGHTS, and also increaing the depth of channel to 20.Complie is running,I expect I will get right result. Thank you very much!!