llvm/openmp/libompd/src/omp-debug.cpp

/*
 * omp-debug.cpp
 *
 *  Created on: Jan 14, 2015
 *      Author: Ignacio Laguna
 *              Joachim Protze
 *     Contact: [email protected]
 *              [email protected]
 */
/*******************************************************************************
 * This implements an OMPD DLL for the LLVM OpenMP runtime library.
 */

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#define NDEBUG

#include "omp-debug.h"
#include "TargetValue.h"
#include "omp.h"
#include "ompd-private.h"
#include <assert.h>
#include <cstdio>
#include <inttypes.h>
#include <pthread.h>
#include <stdint.h>

ompd_device_type_sizes_t type_sizes;
uint64_t ompd_state;
ompd_rc_t ompd_get_num_threads(
    ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
    ompd_word_t *val /* OUT: number of threads */);

/* --- OMPD functions ------------------------------------------------------- */

/* --- Initialization ------------------------------------------------------- */

ompd_rc_t ompd_initialize(ompd_word_t version, const ompd_callbacks_t *table) {}

ompd_rc_t ompd_finalize(void) {}

ompd_rc_t ompd_process_initialize(
    ompd_address_space_context_t
        *context, /* IN: debugger handle for the target */
    ompd_address_space_handle_t **handle /* OUT: ompd handle for the target */
) {}

ompd_rc_t
ompd_get_omp_version(ompd_address_space_handle_t
                         *address_space, /* IN: handle for the address space */
                     ompd_word_t *version) {}

ompd_rc_t ompd_get_omp_version_string(
    ompd_address_space_handle_t
        *address_space, /* IN: handle for the address space */
    const char **string) {}

ompd_rc_t ompd_rel_address_space_handle(
    ompd_address_space_handle_t
        *addr_handle /* IN: handle for the address space */
) {}

ompd_rc_t ompd_device_initialize(ompd_address_space_handle_t *process_handle,
                                 ompd_address_space_context_t *device_context,
                                 ompd_device_t kind, ompd_size_t sizeof_id,
                                 void *id,
                                 ompd_address_space_handle_t **device_handle) {}

/* --- Thread Handles ------------------------------------------------------- */

/* thread_handle is of type (kmp_base_info_t) */

ompd_rc_t ompd_get_thread_in_parallel(
    ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
    int thread_num, /* IN: Thread num, handle of which is to be returned */
    ompd_thread_handle_t **thread_handle /* OUT: handle */
) {}

ompd_rc_t ompd_rel_thread_handle(
    ompd_thread_handle_t
        *thread_handle /* IN: OpenMP thread handle to be released */
) {}

ompd_rc_t ompd_thread_handle_compare(ompd_thread_handle_t *thread_handle_1,
                                     ompd_thread_handle_t *thread_handle_2,
                                     int *cmp_value) {}

/* --- Parallel Region Handles----------------------------------------------- */

/* parallel_handle is of type (kmp_base_team_t)*/

ompd_rc_t ompd_get_curr_parallel_handle(
    ompd_thread_handle_t *thread_handle,     /* IN: OpenMP thread handle*/
    ompd_parallel_handle_t **parallel_handle /* OUT: OpenMP parallel handle */
) {}

ompd_rc_t ompd_get_enclosing_parallel_handle(
    ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
    ompd_parallel_handle_t *
        *enclosing_parallel_handle /* OUT: OpenMP parallel handle */
) {}

ompd_rc_t ompd_get_task_parallel_handle(
    ompd_task_handle_t *task_handle, /* IN: OpenMP task handle */
    ompd_parallel_handle_t *
        *task_parallel_handle /* OUT: OpenMP parallel handle */
) {}

ompd_rc_t ompd_rel_parallel_handle(
    ompd_parallel_handle_t *parallel_handle /* IN: OpenMP parallel handle */
) {}

ompd_rc_t
ompd_parallel_handle_compare(ompd_parallel_handle_t *parallel_handle_1,
                             ompd_parallel_handle_t *parallel_handle_2,
                             int *cmp_value) {}

/* ------- Task Handles ----------------------------------------------------- */

/* task_handle is of type (kmp_taskdata_t) */

ompd_rc_t ompd_get_curr_task_handle(
    ompd_thread_handle_t *thread_handle, /* IN: OpenMP thread handle*/
    ompd_task_handle_t **task_handle     /* OUT: OpenMP task handle */
) {}

ompd_rc_t ompd_get_generating_task_handle(
    ompd_task_handle_t *task_handle,        /* IN: OpenMP task handle */
    ompd_task_handle_t **parent_task_handle /* OUT: OpenMP task handle */
) {}

ompd_rc_t ompd_get_scheduling_task_handle(
    ompd_task_handle_t *task_handle,        /* IN: OpenMP task handle */
    ompd_task_handle_t **parent_task_handle /* OUT: OpenMP task handle */
) {}

ompd_rc_t ompd_get_task_in_parallel(
    ompd_parallel_handle_t *parallel_handle, /* IN: OpenMP parallel handle */
    int thread_num, /* IN: thread num of implicit task of team */
    ompd_task_handle_t **task_handle /* OUT: OpenMP task handle */
) {}

ompd_rc_t ompd_rel_task_handle(
    ompd_task_handle_t *task_handle /* IN: OpenMP task handle */
) {}

ompd_rc_t ompd_task_handle_compare(ompd_task_handle_t *task_handle_1,
                                   ompd_task_handle_t *task_handle_2,
                                   int *cmp_value) {}

ompd_rc_t ompd_get_thread_handle(
    ompd_address_space_handle_t *handle, /* IN: handle for the address space */
    ompd_thread_id_t kind, ompd_size_t sizeof_thread_id, const void *thread_id,
    ompd_thread_handle_t **thread_handle) {}

ompd_rc_t ompd_get_thread_id(
    ompd_thread_handle_t *thread_handle, /* IN: OpenMP thread handle*/
    ompd_thread_id_t kind, ompd_size_t sizeof_thread_id, void *thread_id) {}

/* --- OMPT Thread State Inquiry Analogue ----------------------------------- */

ompd_rc_t ompd_get_state(
    ompd_thread_handle_t *thread_handle, /* IN: OpenMP thread handle*/
    ompd_word_t *state,                  /* OUT: State of this thread */
    ompd_wait_id_t *wait_id              /* OUT: Wait ID */
) {}

/* ---  Task Inquiry -------------------------------------------------------- */

/* ---  Task Settings ------------------------------------------------------- */

/* ---  OMPT Task Inquiry Analogues ----------------------------------------- */

ompd_rc_t
ompd_get_task_frame(ompd_task_handle_t *task_handle, /* IN: OpenMP task handle*/
                    ompd_frame_info_t *exit_frame,
                    ompd_frame_info_t *enter_frame) {}

ompd_rc_t ompd_get_task_function(
    ompd_task_handle_t *task_handle, /* IN: OpenMP task handle */
    ompd_address_t *task_addr /* OUT: first instruction in the task region */
) {}

/* ------- OMPD Version and Compatibility Information ----------------------- */

ompd_rc_t ompd_get_api_version(ompd_word_t *version) {}

ompd_rc_t
ompd_get_version_string(const char **string /* OUT: OMPD version string */
) {}

/* ------ Display Control Variables ----------------------------------------- */

ompd_rc_t ompd_get_display_control_vars(ompd_address_space_handle_t *handle,
                                        const char *const **control_vars) {}

ompd_rc_t ompd_rel_display_control_vars(const char *const **control_vars) {}

/* --- Helper functions ----------------------------------------------------- */

ompd_rc_t initTypeSizes(ompd_address_space_context_t *context) {}