Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sycl): Replaces pragma once with include guards #1709

Merged
merged 1 commit into from
Oct 27, 2024
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
5 changes: 4 additions & 1 deletion include/ceed/jit-source/sycl/sycl-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

/// @file
/// Internal header for SYCL type definitions
#pragma once
#ifndef CEED_SYCL_TYPES_H
#define CEED_SYCL_TYPES_H

#include <ceed/types.h>

Expand All @@ -34,3 +35,5 @@ typedef struct {
CeedInt *outputs[CEED_SYCL_NUMBER_FIELDS];
} FieldsInt_Sycl;
#endif

#endif // CEED_SYCL_TYPES_H
5 changes: 4 additions & 1 deletion include/ceed/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

/// @file
/// Public header for types and macros used in user QFunction source code
#pragma once
#ifndef CEED_QFUNCTION_DEFS_H
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small note - I've seen some people recommend both. Not sure I fully understand the argument why though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, both is a bit perplexing... Maybe to avoid possible guard name conflicts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for a while #pragma once gave faster compile times, but nowadays that's less of a factor

#define CEED_QFUNCTION_DEFS_H

#ifndef CEED_RUNNING_JIT_PASS
#include <stddef.h>
Expand Down Expand Up @@ -252,3 +253,5 @@ typedef enum {
/// Boolean value
CEED_CONTEXT_FIELD_BOOL = 3,
} CeedContextFieldType;

#endif // CEED_QFUNCTION_DEFS_H