Added Makefile instructions for .cu files
This commit is contained in:
parent
9730164e6f
commit
b54842f764
8
Makefile
8
Makefile
@ -58,6 +58,9 @@ ASM = $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.s,$(wildcard $(SRC_DIR)/*.
|
|||||||
OVERWRITE:= $(patsubst $(ASM_DIR)/%-new.s, $(BUILD_DIR)/%.o,$(wildcard $(ASM_DIR)/*-new.s))
|
OVERWRITE:= $(patsubst $(ASM_DIR)/%-new.s, $(BUILD_DIR)/%.o,$(wildcard $(ASM_DIR)/*-new.s))
|
||||||
OBJ = $(filter-out $(BUILD_DIR)/main% $(OVERWRITE),$(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c)))
|
OBJ = $(filter-out $(BUILD_DIR)/main% $(OVERWRITE),$(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c)))
|
||||||
OBJ += $(patsubst $(ASM_DIR)/%.s, $(BUILD_DIR)/%.o,$(wildcard $(ASM_DIR)/*.s))
|
OBJ += $(patsubst $(ASM_DIR)/%.s, $(BUILD_DIR)/%.o,$(wildcard $(ASM_DIR)/*.s))
|
||||||
|
OBJ += $(patsubst $(SRC_DIR)/%.cu, $(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.cu))
|
||||||
|
|
||||||
|
|
||||||
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(OPTIONS) $(INCLUDES)
|
CPPFLAGS := $(CPPFLAGS) $(DEFINES) $(OPTIONS) $(INCLUDES)
|
||||||
|
|
||||||
# $(warning $(OBJ))
|
# $(warning $(OBJ))
|
||||||
@ -88,6 +91,11 @@ $(BUILD_DIR)/%.o: %.s
|
|||||||
$(info ===> ASSEMBLE $@)
|
$(info ===> ASSEMBLE $@)
|
||||||
$(Q)$(AS) $< -o $@
|
$(Q)$(AS) $< -o $@
|
||||||
|
|
||||||
|
$(BUILD_DIR)/%.o: %.cu
|
||||||
|
$(info ===> COMPILE $@)
|
||||||
|
$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
|
||||||
|
$(Q)$(CC) $(CPPFLAGS) -MT $@ -MM $< > $(BUILD_DIR)/$*.d
|
||||||
|
|
||||||
.PHONY: clean distclean tags info asm
|
.PHONY: clean distclean tags info asm
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -82,8 +82,6 @@ double computeForce(
|
|||||||
MD_FLOAT* fz = atom->fz;
|
MD_FLOAT* fz = atom->fz;
|
||||||
#ifndef EXPLICIT_TYPES
|
#ifndef EXPLICIT_TYPES
|
||||||
MD_FLOAT cutforcesq = param->cutforce * param->cutforce;
|
MD_FLOAT cutforcesq = param->cutforce * param->cutforce;
|
||||||
MD_FLOAT sigma6 = param->sigma6;
|
|
||||||
MD_FLOAT epsilon = param->epsilon;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i = 0; i < Nlocal; i++) {
|
for(int i = 0; i < Nlocal; i++) {
|
||||||
@ -103,9 +101,6 @@ double computeForce(
|
|||||||
MD_FLOAT xtmp = atom_x(i);
|
MD_FLOAT xtmp = atom_x(i);
|
||||||
MD_FLOAT ytmp = atom_y(i);
|
MD_FLOAT ytmp = atom_y(i);
|
||||||
MD_FLOAT ztmp = atom_z(i);
|
MD_FLOAT ztmp = atom_z(i);
|
||||||
MD_FLOAT fix = 0;
|
|
||||||
MD_FLOAT fiy = 0;
|
|
||||||
MD_FLOAT fiz = 0;
|
|
||||||
|
|
||||||
#ifdef EXPLICIT_TYPES
|
#ifdef EXPLICIT_TYPES
|
||||||
const int type_i = atom->type[i];
|
const int type_i = atom->type[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user