Merge pull request #33 from lancerts/fix_M_PI_undefined

fix a potential error: identifier M_PI is undefined in the gelu kernal
This commit is contained in:
Andrej 2024-04-09 11:25:23 -07:00 committed by GitHub
commit ea1fad0337
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,14 @@ version 1 is naive port from CPU code to kernel
./gelu_forward 1
*/
/*
If encountering "error: identifier "M_PI" is undefined", add the following lines to the top of the file:
#define _USE_MATH_DEFINES
#include <math.h> OR #include <cmath>
*/
#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>