Skip to content

Commit

Permalink
update flags and goldilocks
Browse files Browse the repository at this point in the history
  • Loading branch information
yann-sjtu committed Sep 4, 2024
1 parent 0e9d5d5 commit 247b222
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions src/config/definitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/goldilocks
Submodule goldilocks updated 0 files
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions src/prover/prover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/memory.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <cstdlib>

#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); }
Expand Down
2 changes: 1 addition & 1 deletion src/utils/memory.cu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <stdint.h>

#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;
Expand Down

0 comments on commit 247b222

Please sign in to comment.