Skip to content

Commit

Permalink
organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
horta committed Dec 1, 2023
1 parent d34ff33 commit 7cd4b5b
Show file tree
Hide file tree
Showing 67 changed files with 129 additions and 213 deletions.
14 changes: 0 additions & 14 deletions c-core/argmax.h

This file was deleted.

6 changes: 4 additions & 2 deletions c-core/argmax_avx.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef ARGMAX_AVX_H
#define ARGMAX_AVX_H

#if __AVX__
#include "argmax_generic.h"
#include "compiler.h"
#include "find.h"
#include "vmax.h"
#include "find_avx.h"
#include "vmax_avx.h"

PURE int argmax2(float *dval, float const x[restrict])
{
Expand Down Expand Up @@ -42,5 +43,6 @@ PURE int argmax20(float *dval, float const x[restrict])
*dval = val;
return i;
}
#endif

#endif
6 changes: 4 additions & 2 deletions c-core/argmax_neon.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#ifndef ARGMAX_NEON_H
#define ARGMAX_NEON_H

#if __ARM_NEON
#include "argmax_generic.h"
#include "compiler.h"
#include "find.h"
#include "vmax.h"
#include "find_neon.h"
#include "vmax_neon.h"

PURE int argmax2(float *dval, float const x[restrict])
{
Expand Down Expand Up @@ -42,5 +43,6 @@ PURE int argmax20(float *dval, float const x[restrict])
*dval = val;
return i;
}
#endif

#endif
2 changes: 1 addition & 1 deletion c-core/codec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "codec.h"
#include "imm/imm.h"
#include "imm/path.h"
#include "protein.h"
#include "state.h"

Expand Down
3 changes: 3 additions & 0 deletions c-core/database_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include "defer_return.h"
#include "error.h"
#include "lip/1darray/1darray.h"
#include "lip/file/read_bool.h"
#include "lip/file/read_float.h"
#include "lip/file/read_int.h"
#include "magic_number.h"
#include "rc.h"
#include "unpack.h"
Expand Down
8 changes: 6 additions & 2 deletions c-core/database_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
#define DATABASE_READER_H

#include "entry_dist.h"
#include "imm/imm.h"
#include "lip/lip.h"
#include "imm/amino.h"
#include "imm/nuclt.h"
#include "imm/nuclt_code.h"
#include "lip/file/file.h"
#include "model_params.h"
#include <stdint.h>
#include <stdio.h>

struct database_reader
{
Expand Down
5 changes: 5 additions & 0 deletions c-core/database_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include "error.h"
#include "fs.h"
#include "lip/1darray/1darray.h"
#include "lip/file/read_int.h"
#include "lip/file/write_array.h"
#include "lip/file/write_bool.h"
#include "lip/file/write_float.h"
#include "lip/file/write_int.h"
#include "magic_number.h"
#include "pack.h"
#include "protein.h"
Expand Down
4 changes: 2 additions & 2 deletions c-core/database_writer.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef DATABASE_WRITER_H
#define DATABASE_WRITER_H

#include "imm/imm.h"
#include "lip/lip.h"
#include "imm/nuclt_code.h"
#include "lip/file/file.h"
#include "model_params.h"
#include "xlimits.h"
#include <stdio.h>
Expand Down
2 changes: 0 additions & 2 deletions c-core/disambiguate.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "array_size.h"
#include "compiler.h"
#include <assert.h>
#include <stddef.h>
#include <stdio.h>

// clang-format off
#define ix(x) \
Expand Down
14 changes: 0 additions & 14 deletions c-core/find.h

This file was deleted.

3 changes: 2 additions & 1 deletion c-core/find_avx.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef FIND_AVX_H
#define FIND_AVX_H

#if __AVX__
#include "asint.h"
#include "compiler.h"
#include "find_generic.h"
#include <immintrin.h>

PURE int find2(float const needle, float const stack[restrict])
Expand Down Expand Up @@ -76,5 +76,6 @@ PURE int find20(float const needle, float const stack[restrict])
int mask = _mm_movemask_ps(_mm_castsi128_ps(_mm_cmpeq_epi32(zi, ki)));
return __builtin_ctz(mask << 16);
}
#endif

#endif
4 changes: 2 additions & 2 deletions c-core/find_neon.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ifndef FIND_NEON_H
#define FIND_NEON_H

#if __ARM_NEON
#include "compiler.h"
#include "find_generic.h"
#include <arm_neon.h>
#include <stdio.h>

PURE uint64_t neon_mask64(int32x2_t const needle, float const stack[restrict])
{
Expand Down Expand Up @@ -75,5 +74,6 @@ PURE int find20(float const needle, float const stack[restrict])
f = neon_mask128(x, stack + 16);
return (__builtin_ctzll(f) >> 4) + 16;
}
#endif

#endif
3 changes: 0 additions & 3 deletions c-core/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@
#endif

#include "fs.h"
#include "array_size.h"
#include "error.h"
#include "rc.h"
#include "xlimits.h"
#include "xstrcpy.h"
#include <assert.h>
#include <errno.h>
#include <ftw.h>
#include <limits.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion c-core/hmm_reader.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "hmm_reader.h"
#include "compiler.h"
#include "error.h"
#include "model.h"
#include "rc.h"
#include <math.h>

static void init_null_lprobs(float[IMM_AMINO_SIZE]);

Expand Down
2 changes: 0 additions & 2 deletions c-core/hmm_reader.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#ifndef HMM_READER_H
#define HMM_READER_H

#include "entry_dist.h"
#include "hmmer_reader/hmmer_reader.h"
#include "imm/imm.h"
#include "model.h"
#include "model_params.h"
#include <stdio.h>
Expand Down
4 changes: 3 additions & 1 deletion c-core/hmmer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "hmmer.h"
#include "error.h"
#include "h3client/h3client.h"
#include "h3client/deadline.h"
#include "h3client/errno.h"
#include "h3client/stream.h"
#include "hmmer_dialer.h"
#include "hmmer_result.h"
#include "rc.h"
Expand Down
3 changes: 2 additions & 1 deletion c-core/hmmer_dialer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "hmmer_dialer.h"
#include "error.h"
#include "h3client/h3client.h"
#include "h3client/deadline.h"
#include "h3client/dialer.h"
#include "hmmer.h"
#include "rc.h"
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion c-core/hmmer_result.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "hmmer_result.h"
#include "error.h"
#include "h3client/h3client.h"
#include "h3client/result.h"
#include "rc.h"
#include <math.h>
#include <stddef.h>
Expand Down
3 changes: 2 additions & 1 deletion c-core/match.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "match.h"
#include "imm/gencode.h"
#include "imm/nuclt_code.h"
#include "protein.h"
#include "state.h"
#include <string.h>

struct match match_init(struct protein const *protein)
{
Expand Down
3 changes: 2 additions & 1 deletion c-core/match.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef MATCH_H
#define MATCH_H

#include "imm/imm.h"
#include "imm/codon.h"
#include "imm/step.h"
#include <stdbool.h>

struct protein;
Expand Down
1 change: 1 addition & 0 deletions c-core/match_iter.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "match_iter.h"
#include "imm/path.h"
#include "match.h"

void match_iter_init(struct match_iter *x, struct imm_seq const *seq,
Expand Down
10 changes: 8 additions & 2 deletions c-core/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
#include "defer_return.h"
#include "entry_dist.h"
#include "error.h"
#include "imm/imm.h"
#include "imm/amino_lprob.h"
#include "imm/codon_lprob.h"
#include "imm/gencode.h"
#include "imm/hmm.h"
#include "imm/lprob.h"
#include "imm/nuclt_code.h"
#include "model.h"
#include "node.h"
#include "nuclt_dist.h"
#include "rc.h"
#include "state.h"
#include "xrealloc.h"
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

Expand Down
5 changes: 1 addition & 4 deletions c-core/model.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#ifndef MODEL_H
#define MODEL_H

#include "entry_dist.h"
#include "imm/imm.h"
#include "imm/amino.h"
#include "model_node.h"
#include "model_params.h"
#include "model_xnode.h"
#include "nuclt_dist.h"
#include "rc.h"
#include "state.h"
#include "trans.h"
#include "xlimits.h"
#include "xtrans.h"
Expand Down
3 changes: 2 additions & 1 deletion c-core/model_node.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef MODEL_NODE_H
#define MODEL_NODE_H

#include "imm/imm.h"
#include "imm/frame_state.h"
#include "imm/mute_state.h"
#include "nuclt_dist.h"

struct model_node
Expand Down
3 changes: 2 additions & 1 deletion c-core/model_xnode.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef MODEL_XNODE_H
#define MODEL_XNODE_H

#include "imm/imm.h"
#include "imm/frame_state.h"
#include "imm/mute_state.h"

struct model_xnode_null
{
Expand Down
3 changes: 2 additions & 1 deletion c-core/nuclt_dist.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "nuclt_dist.h"
#include "error.h"
#include "lip/lip.h"
#include "lip/file/read_array.h"
#include "lip/file/write_array.h"
#include "rc.h"

void nuclt_dist_init(struct nuclt_dist *x, struct imm_nuclt const *nuclt)
Expand Down
5 changes: 4 additions & 1 deletion c-core/nuclt_dist.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef NUCLT_DIST_H
#define NUCLT_DIST_H

#include "imm/imm.h"
#include "imm/codon_marg.h"
#include "imm/nuclt_lprob.h"
#include <stdio.h>

struct nuclt_dist
{
Expand All @@ -10,6 +12,7 @@ struct nuclt_dist
};

struct lip_file;
struct imm_nuclt;

// clang-format off
void nuclt_dist_init(struct nuclt_dist *, struct imm_nuclt const *);
Expand Down
5 changes: 3 additions & 2 deletions c-core/pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#define PACK_H

#include "error.h"
#include "imm/imm.h"
#include "imm/abc.h"
#include "lip/1darray/1darray.h"
#include "lip/lip.h"
#include "lip/file/write_cstr.h"
#include "lip/file/write_map.h"
#include "rc.h"

static inline int pack_key(struct lip_file *stream, char const key[])
Expand Down
3 changes: 1 addition & 2 deletions c-core/partition_size.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "partition_size.h"
#include "imm/imm.h"
#include <assert.h>
#include <limits.h>
#include "imm/max.h"

static inline long ceildiv(long x, long y)
{
Expand Down
1 change: 1 addition & 0 deletions c-core/press.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "error.h"
#include "fs.h"
#include "hmm_reader.h"
#include "imm/gencode.h"
#include "protein.h"
#include "rc.h"
#include "sizeof_field.h"
Expand Down
1 change: 0 additions & 1 deletion c-core/product.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "product.h"
#include "array_size.h"
#include "array_size_field.h"
#include "defer_return.h"
#include "error.h"
Expand Down
2 changes: 0 additions & 2 deletions c-core/product_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
#include "format.h"
#include "fs.h"
#include "hmmer_result.h"
#include "imm/imm.h"
#include "match.h"
#include "match_iter.h"
#include "rc.h"
#include <stdarg.h>
#include <string.h>

int product_thread_init(struct product_thread *x, int tid, char const *dir)
Expand Down
Loading

0 comments on commit 7cd4b5b

Please sign in to comment.