Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.o
*.a
main
main.exe
main-sb*
main-lb*
output.txt
seeds.txt
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ all: main
clean:
rm -f main libcubiomes.a biomenoise.o biomes.o finders.o generator.o layers.o noise.o cubiomes.o gpu.o cpu.o client.o server.o

libcubiomes.a:
libcubiomes.a: $(CUBIOMES_SRC)
$(CC) -c $(CUBIOMES_SRC) -fwrapv $(CFLAGS)
$(AR) rcs libcubiomes.a biomenoise.o biomes.o finders.o generator.o layers.o noise.o

cubiomes.o: src/cubiomes.c src/cubiomes.h
$(CC) -c $< -o $@ $(CFLAGS)

gpu.o: src/gpu.cu src/gpu.h src/common.h src/Random.h
gpu.o: src/gpu.cu src/gpu.h src/common.h src/Random.h src/kernel_0A.h src/kernel_0B.h
nvcc -c $< -o $@ $(NVCC_FLAGS)

cpu.o: src/cpu.cpp src/cpu.h src/common.h src/cubiomes.h
Expand Down
2 changes: 1 addition & 1 deletion src/gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ void GpuThread::run() {
std::printf("Initializing device %d\n", device);

TRY_CUDA(cudaSetDevice(device));
cudaFuncSetAttribute(KernelFilterGradVecs1::kernel, cudaFuncAttributePreferredSharedMemoryCarveout, 100);
TRY_CUDA(cudaFuncSetAttribute(KernelFilterGradVecs1::kernel, cudaFuncAttributePreferredSharedMemoryCarveout, 100));
init_grad_dot_table();
init_conv_kernels();

Expand Down
6 changes: 5 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ struct Args {
auto address = split_address(argv[i++]);
if (!address) {
std::fprintf(stderr, "invalid argument to --client\n");
return false;
}
client = std::move(address);
} else if (std::strcmp("--server", arg) == 0) {
Expand All @@ -120,6 +121,7 @@ struct Args {
auto address = split_address(argv[i++]);
if (!address) {
std::fprintf(stderr, "invalid argument to --server\n");
return false;
}
server = std::move(address);
} else if (std::strcmp("--output", arg) == 0) {
Expand Down Expand Up @@ -303,11 +305,13 @@ int main_inner(int argc, char **argv) {
if (output_file != nullptr) {
std::fclose(output_file);
}

return 0;
}

int main(int argc, char **argv) {
try {
main_inner(argc, argv);
return main_inner(argc, argv);
} catch (std::exception &e) {
std::fprintf(stderr, "Uncaught exception in main: %s\n", e.what());
std::abort();
Expand Down
Loading