提交 ef62c1cc 编写于 作者: C Chon 提交者: GitHub

Merge pull request #670 from zhangyang0701/develop

change namespaces
......@@ -29,15 +29,15 @@ limitations under the License. */
#include "fpga/api/fpga_api.h"
namespace paddle {
namespace mobile {
namespace paddle_mobile {
namespace fpga {
namespace api {
static int fd = -1;
static const char *device_path = "/dev/fpgadrv0";
static inline int do_ioctl(int req, void *arg) { return ioctl(req, arg); }
static inline int do_ioctl(int req, void *arg) {
return ioctl(req, (long unsigned int)arg);
}
int open_device() {
if (fd == -1) {
......@@ -48,8 +48,8 @@ int open_device() {
// memory management;
void *fpga_malloc(size_t size) {
return reinterpret_cast<(void *)> mmap64(NULL, size, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0);
return reinterpret_cast<void *>(
mmap64(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0));
}
void fpga_free(void *ptr) { munmap(ptr, 0); }
......@@ -58,11 +58,9 @@ void fpga_copy(void *dest, const void *src, size_t num) {
memcpy(dest, src, num);
}
int ComputeFpgaConv(struct FpgaConvArgs) {}
int ComputeFpgaPool(struct FpgaPoolArgs) {}
int ComputeFpgaEWAdd(struct FpgaEWAddArgs) {}
int ComputeFpgaConv(struct FpgaConvArgs args) {}
int ComputeFpgaPool(struct FpgaPoolArgs args) {}
int ComputeFpgaEWAdd(struct FpgaEWAddArgs args) {}
} // namespace api
} // namespace fpga
} // namespace mobile
} // namespace paddle
} // namespace paddle_mobile
......@@ -27,17 +27,17 @@ namespace memory {
const int MALLOC_ALIGN = 64;
#ifdef PADDLE_MOBILE_FPGA
namespace api = paddle::mobile::fpga::api;
namespace fpga = paddle_mobile::fpga;
void Copy(void *dst, const void *src, size_t num) {
std::memcpy(dst, src, num);
}
void *Alloc(size_t size) { return api::malloc(size); }
void *Alloc(size_t size) { return fpga::fpga_malloc(size); }
void Free(void *ptr) {
if (ptr) {
api::fpga_free(ptr);
fpga::fpga_free(ptr);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册