diff --git a/Makefile b/Makefile index 54c2d1ff1..3b0d7ed33 100644 --- a/Makefile +++ b/Makefile @@ -159,16 +159,16 @@ $(BUILD_DIR_GPU)/%.asm.o: %.asm # c++ source $(BUILD_DIR_GPU)/%.cpp.o: %.cpp $(MKDIR_P) $(dir $@) - $(CXX) -DENABLE_EXPERIMENTAL_CODE -D__USE_CUDA__ $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ + $(CXX) -D__USE_CUDA__ -DENABLE_EXPERIMENTAL_CODE $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ $(BUILD_DIR_GPU)/%.cc.o: %.cc $(MKDIR_P) $(dir $@) - $(CXX) -D__USE_CUDA__ $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ + $(CXX) -D__USE_CUDA__ -DENABLE_EXPERIMENTAL_CODE $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ # cuda source $(BUILD_DIR_GPU)/%.cu.o: %.cu $(MKDIR_P) $(dir $@) - $(NVCC) -DENABLE_EXPERIMENTAL_CODE -D__USE_CUDA__ $(INC_FLAGS) -Isrc/goldilocks/utils -Xcompiler -fopenmp -Xcompiler -fPIC -Xcompiler -mavx2 -Xcompiler -O3 -O3 -arch=$(CUDA_ARCH) -O3 $< -dc --output-file $@ + $(NVCC) -D__USE_CUDA__ -DENABLE_EXPERIMENTAL_CODE $(INC_FLAGS) -Isrc/goldilocks/utils -Xcompiler -fopenmp -Xcompiler -fPIC -Xcompiler -mavx2 -Xcompiler -O3 -O3 -arch=$(CUDA_ARCH) -O3 $< -dc --output-file $@ main_generator: $(BUILD_DIR)/$(TARGET_MNG) diff --git a/src/config/definitions.hpp b/src/config/definitions.hpp index b611c227c..eae839fe7 100644 --- a/src/config/definitions.hpp +++ b/src/config/definitions.hpp @@ -95,15 +95,15 @@ #define NROWS_PACK 4 -#ifdef __USE_CUDA__ +//#define MULTI_ROM_TEST + +//#define ENABLE_EXPERIMENTAL_CODE + +#if defined(__USE_CUDA__) && defined(ENABLE_EXPERIMENTAL_CODE) #define TRANSPOSE_TMP_POLS false #else #define TRANSPOSE_TMP_POLS true #endif -//#define MULTI_ROM_TEST - -//#define ENABLE_EXPERIMENTAL_CODE - #endif diff --git a/src/goldilocks b/src/goldilocks index f08090a89..0bbd0dcc8 160000 --- a/src/goldilocks +++ b/src/goldilocks @@ -1 +1 @@ -Subproject commit f08090a89f075061da3cb5924a3a23f575e5eaa8 +Subproject commit 0bbd0dcc86d699926095a77cb41a031b4a4c35ab diff --git a/src/main.cpp b/src/main.cpp index 20e6b1402..cd8086561 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -109,6 +109,7 @@ void runFileGenBatchProof(Goldilocks fr, Prover &prover, Config &config) // Call the prover prover.genBatchProof(&proverRequest); + exit(0); } void runFileGenAggregatedProof(Goldilocks fr, Prover &prover, Config &config) diff --git a/src/prover/prover.cpp b/src/prover/prover.cpp index 1b406f163..a2109bef1 100644 --- a/src/prover/prover.cpp +++ b/src/prover/prover.cpp @@ -519,7 +519,7 @@ void Prover::genBatchProof(ProverRequest *pProverRequest) json recursive2Verkey; file2json(config.recursive2Verkey, recursive2Verkey); -#ifdef __USE_CUDA__ +#if defined(__USE_CUDA__) && defined(ENABLE_EXPERIMENTAL_CODE) Goldilocks::Element *publics = (Goldilocks::Element *)malloc_zkevm(starksRecursive1->starkInfo.nPublics); #else Goldilocks::Element publics[starksRecursive1->starkInfo.nPublics]; @@ -731,14 +731,13 @@ void Prover::genBatchProof(ProverRequest *pProverRequest) json2file(jProofRecursive1, pProverRequest->filePrefix + "batch_proof.proof.json"); } -#ifdef __USE_CUDA__ +#if defined(__USE_CUDA__) && defined(ENABLE_EXPERIMENTAL_CODE) free_zkevm(publics); #endif TimerStopAndLog(SAVE_PROOF); } TimerStopAndLog(PROVER_BATCH_PROOF); - assert(0); } void Prover::genAggregatedProof(ProverRequest *pProverRequest) diff --git a/src/utils/memory.cpp b/src/utils/memory.cpp index 28ce3b944..016c77969 100644 --- a/src/utils/memory.cpp +++ b/src/utils/memory.cpp @@ -1,7 +1,7 @@ #include #include -#ifndef __USE_CUDA__ +#if !defined(__USE_CUDA__) || !defined(ENABLE_EXPERIMENTAL_CODE) void *calloc_zkevm(uint64_t count, uint64_t size) { return calloc(count, size); } void *malloc_zkevm(uint64_t size) { return malloc(size); } diff --git a/src/utils/memory.cu b/src/utils/memory.cu index 96eedb69f..e6ae76d5a 100644 --- a/src/utils/memory.cu +++ b/src/utils/memory.cu @@ -1,6 +1,6 @@ #include -#ifdef __USE_CUDA__ +#if defined(__USE_CUDA__) && defined(ENABLE_EXPERIMENTAL_CODE) void *calloc_zkevm(uint64_t count, uint64_t size) { char *a; uint64_t total = count*size;