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

Deprecate sk_types.h and move pscontext class to a separate file pscontext.h #7632

Merged
merged 2 commits into from
Jul 25, 2023
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 src/runtime_src/core/edge/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#
set(MPSOC_HEADER_SRC
xclhal2_mpsoc.h
pscontext.h
sk_types.h)

install (FILES ${MPSOC_HEADER_SRC} DESTINATION ${XRT_INSTALL_INCLUDE_DIR})

message("-- XRT header files for MPSoC only")
message("-- xclhal2_mpsoc.h")
message("-- sk_types.h")
message("-- pscontext.h")
27 changes: 27 additions & 0 deletions src/runtime_src/core/edge/include/pscontext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.

#ifndef __PSCONTEXT_H_
#define __PSCONTEXT_H_

/*
* PS Context Data Structure included by user PS kernel code
*/

class pscontext {
public:
pscontext()
: pimpl{std::make_shared<pscontext::impl>()} {}
virtual ~pscontext() {}

protected:
struct impl;
std::shared_ptr<impl> pimpl;
};

struct pscontext::impl {
private:
bool aie_profile_en;
};

#endif
30 changes: 9 additions & 21 deletions src/runtime_src/core/edge/include/sk_types.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2019-2022 Xilinx, Inc
* Copyright (C) 2023 Advanced Micro Devices, Inc
* Author(s): Min Ma <[email protected]>
* : Larry Liu <[email protected]>
* : Jeff Lin <[email protected]>
Expand Down Expand Up @@ -30,7 +31,8 @@
* freeBO : free BO handle.
* logMsg : send log messages to XRT driver for saving as per ini settings
*/
struct sk_operations {
struct XRT_DEPRECATED
jeffli-xilinx marked this conversation as resolved.
Show resolved Hide resolved
sk_operations {
unsigned int (* getHostBO)(unsigned long paddr, size_t size);
void *(* mapBO)(unsigned int boHandle, bool write);
void (* freeBO)(unsigned int boHandle);
Expand All @@ -45,29 +47,15 @@ struct sk_operations {
* for soft kernel to run.
* ops: provide help functions for soft kernel to use.
*/
XRT_DEPRECATED
typedef int (* kernel_t)(void *args, struct sk_operations *ops);

#pragma message ("sk_types.h is deprecated and will be removed from the distribution directory in a future release. Please use pscontext.h instead.")

/*
* PS Context Data Structure included by user PS kernel code
* Including pscontext.h for backward compatibility with
* PS kernels that were using sk_types.h
*/

class pscontext {
public:
pscontext()
: pimpl{std::make_shared<pscontext::impl>()} {}
virtual ~pscontext() {}

protected:
struct impl;
std::shared_ptr<impl> pimpl;
};

struct pscontext::impl {
private:
bool aie_profile_en;
};

typedef pscontext* (* kernel_init_t)(xclDeviceHandle device, const uuid_t &uuid);
typedef int (* kernel_fini_t)(pscontext *xrtHandles);
#include "pscontext.h"
jeffli-xilinx marked this conversation as resolved.
Show resolved Hide resolved

#endif
5 changes: 4 additions & 1 deletion src/runtime_src/core/edge/skd/xrt_skd.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@
#include "core/common/xclbin_parser.h"
#include "ffi.h"
#include "ps_kernel.h"
#include "sk_types.h"
#include "pscontext.h"
#include "xclbin.h"
#include "xclhal2_mpsoc.h"
#include "xrt/xrt_device.h"

typedef pscontext* (* kernel_init_t)(xclDeviceHandle device, const uuid_t &uuid);
typedef int (* kernel_fini_t)(pscontext *xrtHandles);

namespace xrt {

struct ps_arg {
Expand Down