From eba5d7f58690c79a30da848567f2baeee1c98306 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 13 Apr 2021 10:17:03 -0700 Subject: [PATCH] ircd::gpt: Improve build related; debug/assertions. --- .gitignore | 1 - include/ircd/gpt/hypercall.h | 3 +++ ircd/Makefile.am | 10 +++++----- ircd/gpt_pipe.cc | 3 +++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index caecea19d..fdf519719 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ Makefile *.o *.so *.lo -*.clo *.la *.orig *.log diff --git a/include/ircd/gpt/hypercall.h b/include/ircd/gpt/hypercall.h index 13fda2260..77fd87959 100644 --- a/include/ircd/gpt/hypercall.h +++ b/include/ircd/gpt/hypercall.h @@ -24,6 +24,9 @@ enum ircd_gpt_hypercall /// sets this value; it is the initial value set by the host before /// execution. IRCD_GPT_ECOMPLETE = 0, + + /// Erroneous token buffer + IRCD_GPT_ETOKENS = -1, }; #ifdef __cplusplus diff --git a/ircd/Makefile.am b/ircd/Makefile.am index 2ba9a8907..945636214 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -219,11 +219,11 @@ libircd_la_SOURCES += cl.cc endif libircd_la_SOURCES += gpt.cc libircd_la_SOURCES += gpt_pipe.cc -if OPENCL -BUILT_SOURCES += gpt_cl.clo -endif libircd_la_SOURCES += gpt_model.cc libircd_la_SOURCES += gpt_vocab.cc +if OPENCL +BUILT_SOURCES += gpt_cl.o +endif libircd_la_SOURCES += openssl.cc libircd_la_SOURCES += rfc1459.cc libircd_la_SOURCES += rfc3986.cc @@ -353,5 +353,5 @@ endif default.profdata: -$(LLVM_PROFDATA) merge -output=default.profdata default.proftext -gpt_cl.clo: gpt_cl.cl - clang++-11 -std=CL1.1 -c -pipe -Xclang -finclude-default-header -o gpt_cl.clo $^ +gpt_cl.o: gpt_cl.cl + $(CC) -std=CL1.1 $(AM_CPPFLAGS) $(CPPFLAGS) $(DEFS) -Xclang -finclude-default-header -include "ircd/config.h" -o $@ -c $^ diff --git a/ircd/gpt_pipe.cc b/ircd/gpt_pipe.cc index 32668f651..d05a36479 100644 --- a/ircd/gpt_pipe.cc +++ b/ircd/gpt_pipe.cc @@ -379,6 +379,8 @@ ircd::gpt::pipe::code::compile_opts " -cl-mad-enable" " -cl-single-precision-constant" //" -cl-fp32-correctly-rounded-divide-sqrt" + + " -cl-kernel-arg-info" }; ircd::gpt::pipe::code::code() @@ -893,6 +895,7 @@ noexcept { case IRCD_GPT_ACCEPT: return "ACCEPT"; case IRCD_GPT_ECOMPLETE: return "ECOMPLETE"; + case IRCD_GPT_ETOKENS: return "ETOKENS"; } return "??????";