Skip to content
Closed
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
12 changes: 12 additions & 0 deletions classic/frame/runtime/dlp_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include <stdlib.h>

#include "aocl_dlp_config.h"
#include "bindings/c_wrappers/capi_env_config.h"
#include "classic/aocl_lib_interface_apis.h"
#include "runtime/dlp_runtime.h"
Expand Down Expand Up @@ -212,3 +213,14 @@ dlp_thread_set_num_threads(md_t n_threads)
// env variables will not be of effect going forward.
dlp_tl_rntm.ext_mt_ctr_var = FALSE;
}

void
dlp_version_query(int* major, int* minor, int* patch)
{
if (major)
*major = AOCL_DLP_VERSION_MAJOR;
if (minor)
*minor = AOCL_DLP_VERSION_MINOR;
if (patch)
*patch = AOCL_DLP_VERSION_PATCH;
}
18 changes: 12 additions & 6 deletions cmake/aocl_dlp_config.h.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#ifndef AOCL_DLP_CONFIG_H
#define AOCL_DLP_CONFIG_H

// Version information
#define AOCL_DLP_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@"
#define AOCL_DLP_VERSION_MINOR "@PROJECT_VERSION_MINOR@"
#define AOCL_DLP_VERSION_PATCH "@PROJECT_VERSION_PATCH@"

#define AOCL_DLP_VERSION "@PROJECT_VERSION@"
// Version information - numeric constants
// clang-format off
#define AOCL_DLP_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define AOCL_DLP_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define AOCL_DLP_VERSION_PATCH @PROJECT_VERSION_PATCH@
// clang-format on

// Version information - string constants
#define AOCL_DLP_VERSION_MAJOR_STR "@PROJECT_VERSION_MAJOR@"
#define AOCL_DLP_VERSION_MINOR_STR "@PROJECT_VERSION_MINOR@"
#define AOCL_DLP_VERSION_PATCH_STR "@PROJECT_VERSION_PATCH@"
#define AOCL_DLP_VERSION_STRING "@PROJECT_VERSION@"

// Build configuration
#cmakedefine DLP_ENABLE_OPENMP
Expand Down
1 change: 1 addition & 0 deletions examples/classic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(EXAMPLE_SOURCES
quantization.c
post_ops_combinations.c
eltwise_ops.c
version.c
)

# Create an executable for each example source file
Expand Down
40 changes: 40 additions & 0 deletions examples/classic/version.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright © Advanced Micro Devices, Inc., or its affiliates.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/

#include "aocl_dlp.h"

#include <stdio.h>

int
main()
{
int major, minor, patch;
dlp_version_query(&major, &minor, &patch);
printf("AOCL-DLP Version: %d.%d.%d\n", major, minor, patch);
return 0;
}
2 changes: 2 additions & 0 deletions include/classic/aocl_lib_interface_apis.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ DLP_CLASSIC_EXPORT void
dlp_thread_set_num_threads(md_t n_threads);
DLP_CLASSIC_EXPORT bool
dlp_aocl_enable_instruction_query(void);
DLP_CLASSIC_EXPORT void
dlp_version_query(int* major, int* minor, int* patch);

#endif // AOCL_LIB_INTERFACE_H
Loading